gtk2/gsk/resources/vulkan/blur.vert.glsl
Matthias Clasen 7bb5b8df0b A somewhat working blur shader
This is a very direct implementation of a Gaussian blur,
without any optimizations.
2017-09-04 23:32:31 -04:00

31 lines
666 B
GLSL

#version 420 core
#include "clip.vert.glsl"
layout(location = 0) in vec4 inRect;
layout(location = 1) in float inRadius;
layout(location = 0) out vec2 outPos;
layout(location = 1) out flat float outRadius;
out gl_PerVertex {
vec4 gl_Position;
};
vec2 offsets[6] = { vec2(0.0, 0.0),
vec2(1.0, 0.0),
vec2(0.0, 1.0),
vec2(0.0, 1.0),
vec2(1.0, 0.0),
vec2(1.0, 1.0) };
void main() {
vec4 rect = clip (inRect);
vec2 pos = rect.xy + rect.zw * offsets[gl_VertexIndex];
gl_Position = push.mvp * vec4 (pos, 0.0, 1.0);
outPos = pos;
outRadius = inRadius;
}