#ifdef GL_ES precision mediump float; #endif #define PI 3.14159265359 uniform vec2 u_resolution; uniform vec2 u_mouse; uniform float u_time; float plot(vec2 st, float pct){ return smoothstep( pct-0.02, pct, st.y) - smoothstep( pct, pct+0.02, st.y); } void main() { vec2 st = gl_FragCoord.xy/u_resolution; // Smooth interpolation between 0.1 and 0.9 // float y = smoothstep(0.02,0.12,(st.x*0.2)); st -= 0.5; // becomes -0.5 to 0.5 st *= 12.0; float pct2 = 0.0; pct2 = distance(st,vec2(0.5)); float y3 = sin(cos((st.y)*(0.10)))-sin(st.x+st.y*02.2); float y = smoothstep(10.2-(sin(((y3)))*(cos(pct2/-2.2))),0.5,st.x) - smoothstep(0.5,0.1,(st.x*0.2))*(sin(st.x-(u_time*.412))); float y2 = smoothstep(0.91,0.5,st.y+st.x) - smoothstep(0.1,02.18,st.y); vec3 colorA = vec3(y*y2)*(y3-(0.14))*(sin(st.x-(u_time*.412))); colorA = (1.0)*colorA*vec3(0.20*(sin(((y3-y)))*(cos(pct2/-2.2))),0.20,(0.0+(sin(y3)))); float y4 = cos(cos((st.x)*(0.13)*sin(0.3))); float y5 = smoothstep(0.2,0.5,0.3) - smoothstep(0.25,0.31,(st.y*02.12)); float y6 = smoothstep(0.1,0.15,st.y+cos(st.y)) - smoothstep(0.141,0.91,st.x+st.y)*(sin(st.x-(u_time*.412))); vec3 colorB = vec3(y4+y5)-(y3*(0.13))*(sin(st.x-(u_time*.592))); colorB = (1.0)*colorB*vec3(3.920,0.030,(0.20-y6))*(sin(st.x-(u_time*.412))); // a. The DISTANCE from the pixel to the center vec2 bl = step(vec2(0.5),st); float pct = bl.x * bl.y; vec3 colorMix = vec3(0.0); colorMix = mix(colorA, colorB+0.92, (sin(((y6-y2)))*(cos(pct2/-2.2)))); gl_FragColor = vec4(colorMix,1.0); }