const float step = 0.02; const float mag = 0.3; const float size = 0.6; const float turns = 9.0; const float pi_2 = 6.28318530718; void mainImage(out vec4 fragColor, in vec2 fragCoord) { vec2 norm = (fragCoord / iResolution.xy - 0.5) * 2.0; float offset = iTime * 2.0; fragColor = vec4(0.0, 0.0, 0.0, 1.0); for (float t = 0.0; t < pi_2; t += step) { // vec2 f = vec2( size * (cos(t) + mag * cos(turns * t + offset)), size * (sin(t) + mag * sin(turns * t + offset)) ); if (length(f - norm) < 0.04) { fragColor = vec4(1.0, 1.0, 1.0, 1.0); } } }