33 lines
677 B
GLSL
33 lines
677 B
GLSL
mat2 rotate2D(float r)
|
|
{
|
|
return mat2(cos(r), sin(r), -sin(r), cos(r));
|
|
}
|
|
|
|
void mainImage(out vec4 fragColor, in vec2 fragCoord)
|
|
{
|
|
vec2 uv = (fragCoord.xy - 0.5 * iResolution.xy) / min(iResolution.x, iResolution.y);
|
|
vec3 col = vec3(0);
|
|
float t = iTime * 0.15;
|
|
|
|
vec2 n = vec2(0);
|
|
vec2 q = vec2(0);
|
|
vec2 p = uv;
|
|
float d = dot(p, p);
|
|
float S = 20.0;
|
|
float a = 0.0;
|
|
mat2 m = rotate2D(4.0);
|
|
|
|
for (int j = 0; j < 20; ++j) {
|
|
p *= m;
|
|
n *= m;
|
|
q = p * S + t * 1.0 + sin(t * 4. - d * 6.) * 0.8 + float(j) + n;
|
|
a += dot(cos(q) / S, vec2(0.2));
|
|
n += sin(q);
|
|
S *= 1.2;
|
|
}
|
|
|
|
col = vec3(1.3, 2.5, 4) * (a + 0.3) + a + a + a - (d * 0.5);
|
|
|
|
fragColor = vec4(col, 1.0);
|
|
}
|
|
|