texture_blur2.fp.glsl: reorder
This commit is contained in:
parent
7ef8e2c36e
commit
50f2babca9
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user