#version 330 core #define PI 3.14159265359 uniform vec2 resolution; uniform vec2 mouse; uniform float time; out vec4 color; 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/resolution; vec2 mt = mouse/resolution; float x = st.x; float y; y = pow (x, PI); // y = exp (x - 1); // y = log (x + 1); // y = sqrt (x); // y = step (mt.x, x); // y = smoothstep (mt.x, 1 - mt.x, x); // y = // smoothstep (.2, .5, x) - // smoothstep (.5, .8, x); // y = (sin (2*PI*x + time) + 1)/2; // y = (cos (2*PI*x + time) + 1)/2; // y = mod (x, 1./4)*4; // y = fract (x*4); // y = ceil (x*4)/4; // y = floor (x*4)/4; // y = sign (x - 0.5); // y = abs (x - 1./2)*2; // y = (clamp (x, 1./4, 3./4) - 1./4)*2; // y = min (1./2, x)*2; // y = (max (.5, x) - 1./2)*2; vec3 c = vec3 (y); float pct = plot (st, y); c = (1 - pct)*c + pct*vec3 (0, 1, 0); color = vec4 (c, 1); }