From 8598611c4ae9e89a709789e6a408ba5b17c74ad6 Mon Sep 17 00:00:00 2001 From: langolierz Date: Tue, 10 Jul 2018 12:51:55 +1200 Subject: [PATCH] Create processing-shader.frag --- shader_experiments/processing-shader.frag | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 shader_experiments/processing-shader.frag diff --git a/shader_experiments/processing-shader.frag b/shader_experiments/processing-shader.frag new file mode 100644 index 0000000..f1bc55a --- /dev/null +++ b/shader_experiments/processing-shader.frag @@ -0,0 +1,30 @@ +// Created by inigo quilez - iq/2013 +// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + vec2 q = fragCoord.xy / iResolution.xy; + vec2 uv = 0.5 + (q-0.5)*(0.9 + 0.1*sin(0.2*iTime)); + + vec3 oricol = texture( iChannel0, vec2(q.x,1.0-q.y) ).xyz; + vec3 col; + + col.r = texture(iChannel0,vec2(uv.x+0.003,-uv.y)).x; + col.g = texture(iChannel0,vec2(uv.x+0.000,-uv.y)).y; + col.b = texture(iChannel0,vec2(uv.x-0.003,-uv.y)).z; + + col = clamp(col*0.5+0.5*col*col*1.2,0.0,1.0); + + col *= 0.5 + 0.5*16.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y); + + col *= vec3(0.95,1.05,0.95); + + col *= 0.9+0.1*sin(10.0*iTime+uv.y*1000.0); + + col *= 0.99+0.01*sin(110.0*iTime); + + float comp = smoothstep( 0.2, 0.7, sin(iTime) ); + col = mix( col, oricol, clamp(-2.0+2.0*q.x+3.0*comp,0.0,1.0) ); + + fragColor = vec4(col,1.0); +}