From b91c483b61c5590692c4e71a6c1979e08bc53e0d Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sat, 19 May 2018 16:42:09 +0200 Subject: [PATCH] Add wavey.glsl --- wavey.glsl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 wavey.glsl diff --git a/wavey.glsl b/wavey.glsl new file mode 100644 index 0000000..70a84ce --- /dev/null +++ b/wavey.glsl @@ -0,0 +1,29 @@ +#ifdef GL_ES +precision mediump float; +#endif + +uniform vec2 resolution; +uniform float time; + +void main() { + vec2 uPos = ( gl_FragCoord.xy / resolution.xy );//normalize wrt y axis + //suPos -= vec2((resolution.x/resolution.y)/2.0, 0.0);//shift origin to center + + uPos.x -= 1.0; + uPos.y -= 0.5; + + vec3 color = vec3(0.0); + float vertColor = 0.0; + for( float i = 0.0; i < 15.0; ++i ) + { + float t = time * (0.9); + + uPos.y += sin( uPos.x*i + t+i/2.0 ) * 0.1; + float fTemp = abs(1.0 / uPos.y / 100.0); + vertColor += fTemp; + color += vec3( fTemp*(10.0-i)/10.0, fTemp*i/10.0, pow(fTemp,1.5)*1.5 ); + } + + vec4 color_final = vec4(color, 1.0); + gl_FragColor = color_final; +}