// const int OUTPUT_RES = 700; // const float RES = float( OUTPUT_RES - 1 ); uniform sampler2D LeftUnit, RightUnit; // uniform float T; // uniform float ResS, ResT; // varying float X, Y; void main() { vec2 st = gl_TexCoord[0].st; // int row = int( RES*(X+1.)/2. + 0.5 ); // int col = int( RES*(Y+1.)/2. + 0.5 ); int row = int( gl_FragCoord.x ); int col = int( gl_FragCoord.y ); int sum = row + col; vec4 color; if( ( sum % 2 ) == 0 ) { color = texture2D( LeftUnit, st ); } else { color = texture2D( RightUnit, st ); } gl_FragColor = vec4( color.rgb, 1. ); }