From 50f2babca99f10d15f0982a2c249d1744e10335b Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Tue, 28 Oct 2025 14:28:16 -0500 Subject: [PATCH] texture_blur2.fp.glsl: reorder --- src/texture_blur2.fp.glsl | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/texture_blur2.fp.glsl b/src/texture_blur2.fp.glsl index d681fcd..da75e0c 100644 --- a/src/texture_blur2.fp.glsl +++ b/src/texture_blur2.fp.glsl @@ -15,33 +15,36 @@ void main() { vec2 uv0 = gl_TexCoord[0].xy; - vec2 uv3n = vec2(uv0.x - offset[3], uv0.y); - vec2 uv2n = vec2(uv0.x - offset[2], uv0.y); - vec2 uv1n = vec2(uv0.x - offset[1], uv0.y); + vec2 uv1n = vec2(uv0.x - offset[1], uv0.y); // temp[1] + vec2 uv1p = vec2(uv0.x + offset[1], uv0.y); // - vec2 uv1p = vec2(uv0.x + offset[1], uv0.y); - vec2 uv2p = vec2(uv0.x + offset[2], uv0.y); - vec2 uv3p = vec2(uv0.x + offset[3], uv0.y); + vec2 uv2n = vec2(uv0.x - offset[2], uv0.y); // temp[2] + vec2 uv2p = vec2(uv0.x + offset[2], uv0.y); // + + vec2 uv3n = vec2(uv0.x - offset[3], uv0.y); // temp[3] + vec2 uv3p = vec2(uv0.x + offset[3], uv0.y); // vec3 s0 = texture2D(texture1, uv0).rgb; - vec3 s3n = texture2D(texture1, uv3n).rgb; - vec3 s2n = texture2D(texture1, uv2n).rgb; vec3 s1n = texture2D(texture1, uv1n).rgb; - vec3 s1p = texture2D(texture1, uv1p).rgb; + + vec3 s2n = texture2D(texture1, uv2n).rgb; vec3 s2p = texture2D(texture1, uv2p).rgb; + + vec3 s3n = texture2D(texture1, uv3n).rgb; vec3 s3p = texture2D(texture1, uv3p).rgb; vec3 col = s0 * weight[0]; - col = s3n * weight[3] + col; - col = s2n * weight[2] + col; col = s1n * weight[1] + col; - col = s1p * weight[1] + col; + + col = s2n * weight[2] + col; col = s2p * weight[2] + col; + col = s3p * weight[3] + col; + col = s3n * weight[3] + col; //gl_FragColor = vec4(col, 1.0); gl_FragColor = vec4(s0, 1.0);