Skip to content

Instantly share code, notes, and snippets.

@sortofsleepy
Last active December 30, 2015 15:18
Show Gist options
  • Save sortofsleepy/7847046 to your computer and use it in GitHub Desktop.
Save sortofsleepy/7847046 to your computer and use it in GitHub Desktop.
Fragment shader study #2
/**
Slits
@sortofsleepy
*/
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
void main( void ) {
vec2 position = ( gl_FragCoord.xy / resolution.xy );
float color = 0.0;
color += sin( position.x * sin( time / 5.0 ) * 10.0 ) + sin( position.y * sin( time / 35.0 ) * 80.0 );
color *= tan(resolution.y * gl_FragCoord.x);
//color += position.x * cos(position.y) * time;
gl_FragColor = vec4( vec3( color, color * 0.5, sin( color + time / 3.0 ) * 0.75 ), 1.0 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment