oculus1
diff sdr/sdr.glsl @ 18:1b107de821c1
fixed the test to work with non-pow2 textures
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 26 Sep 2013 10:33:08 +0300 |
parents | f3672317e5c2 |
children |
line diff
1.1 --- a/sdr/sdr.glsl Sat Sep 21 07:09:48 2013 +0300 1.2 +++ b/sdr/sdr.glsl Thu Sep 26 10:33:08 2013 +0300 1.3 @@ -2,6 +2,7 @@ 1.4 uniform float aspect, scale; 1.5 uniform float lens_center_offset; 1.6 uniform vec4 dist_factors; 1.7 +uniform vec2 tex_scale; 1.8 1.9 vec2 distort_texcoords(in vec2 tc); 1.10 float barrel_scale(float x, in vec4 k); 1.11 @@ -10,9 +11,9 @@ 1.12 { 1.13 vec2 tc = distort_texcoords(gl_TexCoord[0].xy); 1.14 1.15 - float vis = any(greaterThan(tc, vec2(1.0)) || lessThan(tc, vec2(0.0))) ? 0.0 : 1.0; 1.16 + float vis = any(greaterThan(tc, vec2(1.0))) || any(lessThan(tc, vec2(0.0))) ? 0.0 : 1.0; 1.17 1.18 - gl_FragColor.rgb = texture2D(tex, tc).rgb * vis; 1.19 + gl_FragColor.rgb = texture2D(tex, tc * tex_scale).rgb * vis; 1.20 gl_FragColor.a = 1.0; 1.21 } 1.22