opengl2/src/texture_blur.fp.glsl
2025-10-28 12:07:50 -05:00

29 lines
611 B
GLSL

#version 120
uniform sampler2D texture1;
float weight[4] = float[] (0.24609375,
0.205078125,
0.1171875,
0.0439453125);
void main()
{
vec2 uv = gl_TexCoord[0].xy;
vec3 col = texture2D(texture1, uv).rgb;
float texel = 1.0 / 128;
if (true) {
col *= weight[0];
for (int i = 1; i < 4; i++) {
vec2 offset = vec2(texel * float(i), 0.0);
col += texture2D(texture1, uv + offset).rgb * weight[i];
col += texture2D(texture1, uv - offset).rgb * weight[i];
}
}
gl_FragColor = vec4(col, 1.0);
}