| 1 |
// from: https://www.shadertoy.com/view/XtjGRD |
| 2 |
|
| 3 |
float circle(in vec2 pos, in float t, in float mult) |
| 4 |
{ |
| 5 |
vec2 center = vec2(0.5, 0.5 * iResolution.y / iResolution.x); |
| 6 |
vec2 v = vec2(center.x + cos(t) * 0.1, center.y + sin(t) * 0.1) - pos; |
| 7 |
|
| 8 |
float dist2 = dot(v, v); |
| 9 |
float circles = 0.5 + cos(dist2 * mult) * 0.5; |
| 10 |
float darkening = smoothstep(0.0, 0.5, 1.0 - length(v) * 2.0); |
| 11 |
|
| 12 |
return circles * darkening; |
| 13 |
} |
| 14 |
|
| 15 |
void mainImage(out vec4 fragColor, in vec2 fragCoord) |
| 16 |
{ |
| 17 |
vec2 pos = fragCoord.xy / iResolution.x; |
| 18 |
float t = iGlobalTime * 0.25; |
| 19 |
|
| 20 |
float r = circle(pos, t + 0.0, 100.0 + sin(t * 0.6 + 1.0) * 100.0); |
| 21 |
float g = circle(pos, t + 0.5, 100.0 + sin(t * 0.6 + 2.0) * 100.0); |
| 22 |
float b = circle(pos, t + 1.0, 100.0 + sin(t * 0.6 + 3.0) * 100.0); |
| 23 |
float w = circle(pos, t + 1.5, 1000.0 + sin(t + 4.0) * 200.0) * 0.35; |
| 24 |
|
| 25 |
fragColor = vec4(r+w, g+w, b+w, 1.0); |
| 26 |
} |
| 27 |
|