kwin/shaders/1.40/lanczos-fragment.glsl
Fredrik Höglund 54b63a85a6 kwin: Add GLSL 1.40 versions of the scene shaders
Adjust ShaderManager to load the 1.40 versions when GLSL 1.40
is supported.
2013-05-08 18:33:03 +02:00

19 lines
447 B
GLSL

#version 140
uniform sampler2D texUnit;
uniform vec2 offsets[16];
uniform vec4 kernel[16];
in vec2 varyingTexCoords;
out vec4 fragColor;
void main(void)
{
vec4 sum = texture(texUnit, varyingTexCoords.st) * kernel[0];
for (int i = 1; i < 16; i++) {
sum += texture(texUnit, varyingTexCoords.st - offsets[i]) * kernel[i];
sum += texture(texUnit, varyingTexCoords.st + offsets[i]) * kernel[i];
}
fragColor = sum;
}