119c06e403
This makes it possible for the GLSL compiler to unroll it, which also avoids the need to use relative addressing. With this change the shader should hopefully work with the R300G driver. The unused kernel weights are set to zero so they don't contribute to the end result. Thanks to Tom Stellard and Marek Olšák for their suggestions on how to solve this problem. CCBUG: 243191 svn path=/trunk/KDE/kdebase/workspace/; revision=1175021
14 lines
389 B
GLSL
14 lines
389 B
GLSL
uniform sampler2D texUnit;
|
|
uniform vec2 offsets[25];
|
|
uniform vec4 kernel[25];
|
|
|
|
void main(void)
|
|
{
|
|
vec4 sum = texture2D(texUnit, gl_TexCoord[0].st) * kernel[0];
|
|
for (int i = 1; i < 25; 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;
|
|
}
|
|
|