forked from peterderivaz/pyopengles
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbasic.glsl
More file actions
17 lines (12 loc) · 660 Bytes
/
Copy pathbasic.glsl
File metadata and controls
17 lines (12 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// From http://mrdoob.com/lab/javascript/webgl/glsl/03/
uniform float time;
uniform vec2 resolution;
void main( void ) {
vec2 position = gl_FragCoord.xy / resolution.xy;
float color = 0.0;
color += sin( position.x * cos( time / 15.0 ) * 80.0 ) + cos( position.y * cos( time / 15.0 ) * 10.0 );
color += sin( position.y * sin( time / 10.0 ) * 40.0 ) + cos( position.x * sin( time / 25.0 ) * 40.0 );
color += sin( position.x * sin( time / 5.0 ) * 10.0 ) + sin( position.y * sin( time / 35.0 ) * 80.0 );
color *= sin( time / 10.0 ) * 0.5;
gl_FragColor = vec4( vec3( color, color * 0.5, sin( color + time / 3.0 ) * 0.75 ), 1.0 );
}