Closed GoogleCodeExporter closed 9 years ago
Thanks for reporting this!
It appears to be a bug in the way we rewrite the code to support
short-circuiting behavior for the && operator. A quick workaround is to rewrite
the shader as follows:
uniform sampler2D samp,csamp;
uniform float h;
varying vec2 tc;
void main(void) {
gl_FragColor = texture2D(samp,tc);
vec2 mtc = tc; //modified texture coord, considering the boundary condition
if(gl_FragColor.b > 0.){
{mtc.r += (fract(tc.r/2./h)>0.5 && texture2D(samp,vec2(tc.r+h,tc.g)).b==0.) ? 0.5*h : 0.;}
{mtc.r -= (fract(tc.r/2./h)<0.5 && texture2D(samp,vec2(tc.r-h,tc.g)).b==0.) ? 0.5*h : 0.;}
{mtc.g += (fract(tc.g/2./h)>0.5 && texture2D(samp,vec2(tc.r,tc.g+h)).b==0.) ? 0.5*h : 0.;}
{mtc.g -= (fract(tc.g/2./h)<0.5 && texture2D(samp,vec2(tc.r,tc.g-h)).b==0.) ? 0.5*h : 0.;}
gl_FragColor.g += texture2D(csamp,mtc).g*4.;
}
}
Note the added curly brackets.
We'll see what can be done to fix this within ANGLE...
Original comment by nicolas....@gmail.com
on 10 Jan 2013 at 5:00
Issue 412 has been merged into this issue.
Original comment by nicolas....@gmail.com
on 19 Feb 2013 at 2:25
Let's make sure to add one or more WebGL conformance tests covering this issue
once a fix is found.
Original comment by kbr@chromium.org
on 19 Feb 2013 at 10:08
Original comment by nicolas....@gmail.com
on 21 Feb 2013 at 3:38
Fixed in r1835.
Original comment by nicolas....@gmail.com
on 28 Feb 2013 at 10:32
Original issue reported on code.google.com by
wild...@gmail.com
on 10 Jan 2013 at 1:14