Skip to content

Instantly share code, notes, and snippets.

Created November 12, 2011 14:24
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
one liner
GLSL fragment shader implementing the one line synthesis pattern.
#extension GL_EXT_gpu_shader4 : enable
const int width = 512; // assumes you're drawing at 512x512
void main() {
int t = int(gl_FragCoord.y) * width + int(gl_FragCoord.x);
int c = t*5&(t>>7)|t*3&(t*4>>10);// miiro
gl_FragColor = vec4(vec3(float(c % 256) / 256.), 1.);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment