Ambient kaleidoscope

GLSL shader by claudegl · created 2026-06-24 · 10s loop · 1 pass

Ambient kaleidoscope — realtime GLSL.

Tags: glsl, generative, fractal

This page opens the shader in the ShaderKit browser GLSL editor: edit it live, fork it, or render it to video, GIF or images up to 8K. Also available as a full-screen view and an embeddable player.

Shader source (GLSL)

Common

#define pi acos(-1.)
#define deg pi/180.
#define time iTime*2.*pi/10.
#define R iResolution.xy
#define ar R.x/R.y
#define M iMouse
#define xm (M.xy/R)
#define nm ((xm.xy-0.5)*vec2(ar,1.)+0.5)
mat2 r2d(float a) {
    return mat2(cos(a),sin(a),-sin(a),cos(a));
}

Buffer A (iChannel0)

// ── 00 · Ambient kaleidoscope ──────────────────────────────────────────────
// Slide: cold open. Runs while people arrive. Calm, slow, hypnotic — not busy.
// ShaderKit: single pass. No feedback. Optional sliders: uSpeed, uFold.
// Paste this whole file into the Image / iChannel0 tab.
// ───────────────────────────────────────────────────────────────────────────

#define PI 3.14159265359

mat2 rot(float a){ float c=cos(a), s=sin(a); return mat2(c,-s,s,c); }

// iq cosine palette — cheap, gorgeous, loops forever.
vec3 pal(float t){
    return 0.5 + 0.5*cos(6.2831*(vec3(1.0,1.0,1.0)*t + vec3(0.0,0.33,0.67)));
}

void mainImage(out vec4 fragColor, in vec2 fragCoord){
    vec2 uv = (2.0*fragCoord - iResolution.xy) / iResolution.y;

    float t = iTime * 0.06;                 // uSpeed lives here
    uv *= rot(t);                            // slow global turn

    // to polar, then mirror the angle into N wedges -> kaleidoscope
    float r = length(uv);
    float a = atan(uv.y, uv.x);
    float fold = 6.0;                        // uFold
    a = abs(mod(a, 2.0*PI/fold) - PI/fold);

    // gentle radial breathing pattern
    float v = sin(a*fold*1.5 + sin(r*6.0 - iTime*0.5));
    v += 0.5*sin(r*10.0 - iTime*0.3);
    float glow = 0.6 / (0.15 + abs(v));      // soft bright filaments

    vec3 col = pal(r*0.5 + a*0.2 + t) * glow;
    col = mix(col, vec3(dot(col, vec3(0.33))), 0.1);   // slight desaturate
    col *= smoothstep(2.0, 0.2, r);          // vignette to black

    fragColor = vec4(pow(col, vec3(0.85)), 1.0);
}

More shaders by claudegl

Browse all public shaders · All shaders by claudegl · ShaderKit home

Vibe Mode BETA
💰 ~0 credits
Uniforms
FPS: 0
Time: 0
Resolution: 0 x 0

Account

FPS: -- Time: -- --×-- 1x