URL: http://glslsandbox.com/e#20324.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
// Trig Fractal // By: Brandon Fogerty // bfogerty at gmail dot com // xdpixel.com #ifdef GL_ES precision mediump float; #endif uniform float time; uniform vec2 mouse; uniform vec2 resolution; void main( void ) { vec2 uv = ( gl_FragCoord.xy / resolution.xy ) * resolution.y/resolution.x; float t = time * 0.1; // Rotate the uv coordinates. float x1 = uv.x; float y1 = uv.y; uv.x = x1*cos(t) - y1*sin(t); uv.y = x1*sin(t) + y1*cos(t); // Render a line pattern along the x axis float zoomFactor = 50.0+(sin(time * 1.0)*0.50 + 0.50)*5.0; float x = sin(uv.x * zoomFactor); float y = sin(uv.y * zoomFactor); float c = sin( cos(tan( cos(x) + sin(y) )) + tan( cos(x) + sin(y) ) ); gl_FragColor = vec4( c*uv.x, c*uv.y, c*sin(uv.x*uv.y+time), 1.0 ); } |