kwin/lanczos-fragment.glsl
Fredrik Höglund 35dcccb847 Rewrite the ARB lanczos shader to work with the Radeon R300 limitations.
svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1215505
2011-01-18 22:43:08 +00:00

14 lines
389 B
GLSL

uniform sampler2D texUnit;
uniform vec2 offsets[16];
uniform vec4 kernel[16];
void main(void)
{
vec4 sum = texture2D(texUnit, gl_TexCoord[0].st) * kernel[0];
for (int i = 1; i < 16; i++) {
sum += texture2D(texUnit, gl_TexCoord[0].st - offsets[i]) * kernel[i];
sum += texture2D(texUnit, gl_TexCoord[0].st + offsets[i]) * kernel[i];
}
gl_FragColor = sum;
}