Breathing domain warp

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

Breathing domain warp — 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)

// ── 06 · Breathing domain warp ──────────────────────────────────────────────
// Slide: "everything breathes." Feed the coordinate through noise before you
// use it (warp), nest it twice, animate slowly -> surfaces undulate and flow.
// The gentle "the walls are breathing." Quick one.
// ShaderKit: single pass. Slider: uSpeed (default 0.1).
// ───────────────────────────────────────────────────────────────────────────

vec3 pal(float t){ return 0.5+0.5*cos(6.2831*(t+vec3(0.0,0.35,0.7))); }
float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1,311.7)))*43758.5453123); }
float noise(vec2 p){
    vec2 i=floor(p), f=fract(p); f=f*f*(3.0-2.0*f);
    return mix(mix(hash(i), hash(i+vec2(1,0)), f.x),
               mix(hash(i+vec2(0,1)), hash(i+vec2(1,1)), f.x), f.y);
}
float fbm(vec2 p){ float v=0.0,a=0.5; for(int i=0;i<5;i++){ v+=a*noise(p); p*=2.0; a*=0.5; } return v; }

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

    // two nested warps — the coordinate gets pushed around by its own noise
    vec2 q = vec2(fbm(p + t), fbm(p + vec2(5.2,1.3) - t));
    vec2 r = vec2(fbm(p + 4.0*q + vec2(1.7,9.2)), fbm(p + 4.0*q + vec2(8.3,2.8)));
    float f = fbm(p + 4.0*r);

    vec3 col = mix(pal(0.10), pal(0.60), f);
    col = mix(col, pal(0.90), clamp(length(q)*0.5,0.0,1.0));
    col = mix(col, pal(0.30), r.x*0.4);
    col *= 0.85 + 0.15*sin(iTime*0.6);          // slow brightness breath
    fragColor = vec4(pow(col, vec3(0.9)), 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