Gallery

Roundies

Live parameters

Geometry
25.00
Motion
1.00
Color
GLSL source
// This is an old shader left in my shaders folder. I cannot recall who's shader this was made off of.
// I just remember myself trying to understand a shader of someone else.
// If you want to understand how this shader works, 
// put `fragColor = vec4(<x>);` in the last line where <x> is one of a,b,c,d,e floats
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uv = (fragCoord * 2. - iResolution.xy) / iResolution.y;
    vec2 center = (iMouse.xy * 2.0 - iResolution.xy) / iResolution.y;
    const float scale = 0.5;
    uv *= scale; center *= scale;

    vec2 gridc = fract(uv * GRID);
    float a = distance(gridc, vec2(.5));

    float r = mod(iTime * TIME_SCALE * 0.5, 2.);
    float b = smoothstep(r - .4, r - .2, distance(uv, center));
    float c = smoothstep(r - .0, r - .5, distance(uv, center));
    float d = clamp(c * b, 0.01, 0.9);
    float e = 1. - smoothstep(d, d+0.08, a);

    vec3 ct = mix(CA, CB, uv.x * uv.y) * e;
    fragColor = vec4(ct, e);
}