Created
November 12, 2011 14:24
-
-
Save kylemcdonald/1360582 to your computer and use it in GitHub Desktop.
one liner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
GLSL fragment shader implementing the one line synthesis pattern. | |
http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html | |
*/ | |
#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