Return to Snippet

Revision: 26249
at April 21, 2010 14:43 by vorp


Initial Code
vec2 pos = mod(gl_FragCoord.xy,vec2(100));
		if ((pos.x > 50.0)&&(pos.y > 50.0)){
			gl_FragColor=vec4(1.0, 1.0, 1.0, 1.0);
		}
		if ((pos.x < 50.0)&&(pos.y < 50.0)){
			gl_FragColor=vec4(1.0, 1.0, 1.0, 1.0);
		}
		if ((pos.x < 50.0)&&(pos.y > 50.0)){
			gl_FragColor=vec4(0.0, 0.0, 0.0, 1.0);
		}
		if ((pos.x > 50.0)&&(pos.y < 50.0)){
			gl_FragColor=vec4(0.0, 0.0, 0.0, 1.0);
		}

Initial URL

                                

Initial Description
This, in the .frag shader will produce a screen-space checkboard.

Initial Title
GLSL screen space checkerboard

Initial Tags

                                

Initial Language
C