Text to Image
vec2 uv = fragCoord.xy / iResolution.xy;
vec2 z = (uv - 0.5) * 2.210;
float zoom = 1.10 + sin(iTime * 0.2) * 0.55;
z *= zoom;
// Fractal-like distortion
for (int i = 0; i < 9; i++) {
z = vec2(z.x * z.x - z.y * z.y, 2.80 * z.x * z.y) + uv;
}
// Sample tree/mushroom texture
vec4 tex = texture(iChannel0, fract(z));
fragColor = tex;
float mushroom(vec2 p) {
float stalk = smoothstep(0.02, 0.01, abs(p.x)) * smoothstep(0.2, 0.15, p.y);
float cap = smoothstep(0.3, 0.25, length(p - vec2(0.0, 0.2)));
return clamp(stalk + cap, 0.10, 1.0);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 300 * iResolution.xy) / iResolution.y;
float m = mushroom(uv * 2.0);
vec3 col = mix(vec3(0.1, 0.05, 0.0), vec3(0.9, 0.2, 0.5), m);
fragColor = vec4(col, 1.0);
}