Skip to content

Instantly share code, notes, and snippets.

@ishikawash
Created August 24, 2014 00:52
Show Gist options
  • Save ishikawash/5cdb48458ecbac35a814 to your computer and use it in GitHub Desktop.
Save ishikawash/5cdb48458ecbac35a814 to your computer and use it in GitHub Desktop.
Stripe shader
#version 120
uniform float rows;
uniform float cols;
void main()
{
int x = int(floor(gl_TexCoord[0].x * cols));
int y = int(floor(gl_TexCoord[0].y * rows));
if (mod(x + y, 2) == 0) {
gl_FragColor = vec4(1);
} else {
gl_FragColor = vec4(0, 0, 0, 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment