Skip to content

Instantly share code, notes, and snippets.

@tado
Last active November 29, 2015 01:19
Show Gist options
  • Save tado/239884d10cd720ebb921 to your computer and use it in GitHub Desktop.
Save tado/239884d10cd720ebb921 to your computer and use it in GitHub Desktop.
50 . Shades of Grey for GLSL
uniform vec2 u_resolution;
void main(){
vec2 st = gl_FragCoord.xy/u_resolution.xy;
vec3 color;
float shaders = 50.0;
for(float i = 0.0; i < shaders; i++){
float left = step(1.0/shaders*(shaders - i), st.x);
color += vec3(left * 1.0/shaders);
gl_FragColor = vec4(color,1.0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment