Claude Cool

GLSL shader by scry · created 2026-02-05 · 10s loop · 2 passes

Result of asking Claude (Vibe Mode) "Make an awesome shader" then asking "make it cooler" over and over a bunch of times.

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.  //1 degree
#define time iTime*2.*pi/10. //sin(time) loops 10 seconds
#define R iResolution.xy //shorthand
#define ar R.x/R.y //aspect ratio
#define M iMouse //shorthand
#define xm (M.xy/R) //normalized mouse
#define nm ((xm.xy-0.5)*vec2(ar,1.)+0.5) //aspect ratio correction
vec3 cs = vec3(1.,2.,3.);
mat2 r2d(float a) {
    return mat2(cos(a),sin(a),-sin(a),cos(a));
}

Buffer A (iChannel0)

// Hash functions
float hash21(vec2 p) {
    return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
}

vec2 hash22(vec2 p) {
    p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));
    return fract(sin(p) * 43758.5453);
}

vec3 hash33(vec3 p) {
    p = fract(p * vec3(0.1031, 0.1030, 0.0973));
    p += dot(p, p.yxz + 33.33);
    return fract((p.xxy + p.yxx) * p.zyx);
}

// 3D noise
float noise3d(vec3 p) {
    vec3 i = floor(p);
    vec3 f = fract(p);
    f = f * f * (3.0 - 2.0 * f);
    
    float n = i.x + i.y * 57.0 + 113.0 * i.z;
    return mix(
        mix(mix(hash21(vec2(n, 0.)), hash21(vec2(n + 1., 0.)), f.x),
            mix(hash21(vec2(n + 57., 0.)), hash21(vec2(n + 58., 0.)), f.x), f.y),
        mix(mix(hash21(vec2(n + 113., 0.)), hash21(vec2(n + 114., 0.)), f.x),
            mix(hash21(vec2(n + 170., 0.)), hash21(vec2(n + 171., 0.)), f.x), f.y),
        f.z);
}

// Voronoi with animated cells
vec3 voronoi(vec2 p, float t) {
    vec2 i = floor(p);
    vec2 f = fract(p);
    
    float minDist = 10.0;
    float secondMin = 10.0;
    vec2 minPoint;
    vec2 minCell;
    
    for(int y = -1; y <= 1; y++) {
        for(int x = -1; x <= 1; x++) {
            vec2 neighbor = vec2(float(x), float(y));
            vec2 cellId = i + neighbor;
            vec2 offset = hash22(cellId);
            offset = 0.5 + 0.5 * sin(t + 6.28 * offset);
            vec2 point = neighbor + offset - f;
            float dist = length(point);
            
            if(dist < minDist) {
                secondMin = minDist;
                minDist = dist;
                minPoint = point;
                minCell = cellId;
            } else if(dist < secondMin) {
                secondMin = dist;
            }
        }
    }
    
    return vec3(minDist, secondMin - minDist, hash21(minCell));
}

// Fractal noise
float fbm(vec2 p, float t) {
    float value = 0.0;
    float amplitude = 0.5;
    mat2 rot = r2d(t * 0.1);
    
    for(int i = 0; i < 8; i++) {
        value += amplitude * voronoi(p, t * 0.5).x;
        p = rot * p * 2.0 + t * 0.1;
        amplitude *= 0.5;
    }
    
    return value;
}

// 3D fbm
float fbm3d(vec3 p) {
    float value = 0.0;
    float amplitude = 0.5;
    for(int i = 0; i < 5; i++) {
        value += amplitude * noise3d(p);
        p *= 2.5;
        amplitude *= 0.5;
    }
    return value;
}

// Plasma effect
float plasma(vec2 p, float t) {
    float c = sin(p.x * 10.0 + t);
    c += sin(p.y * 10.0 + t * 1.3);
    c += sin((p.x + p.y) * 10.0 + t * 0.7);
    c += sin(length(p) * 10.0 + t * 1.5);
    return c * 0.25;
}

// Kaleidoscope effect
vec2 kaleidoscope(vec2 p, float segments) {
    float angle = atan(p.y, p.x);
    float radius = length(p);
    angle = mod(angle, 6.28 / segments);
    if(mod(floor(atan(p.y, p.x) / (6.28 / segments)), 2.0) < 1.0) {
        angle = 6.28 / segments - angle;
    }
    return vec2(cos(angle), sin(angle)) * radius;
}

// Tunnel effect
vec2 tunnel(vec2 p, float t) {
    float r = length(p);
    float a = atan(p.y, p.x);
    return vec2(a / 6.28 + t * 0.1, 1.0 / r + t * 0.2);
}

// Mandelbrot-like iteration
float mandel(vec2 c, int maxIter) {
    vec2 z = vec2(0.);
    for(int i = 0; i < maxIter; i++) {
        z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + c;
        if(dot(z, z) > 4.0) return float(i) / float(maxIter);
    }
    return 0.0;
}

// Chromatic aberration
vec3 chromaticAberration(vec2 uv, vec2 center, float amount) {
    vec2 dir = uv - center;
    return vec3(
        length(dir - dir * amount * 0.01),
        length(dir),
        length(dir + dir * amount * 0.01)
    );
}

// Fractal domain warping
vec2 fractalWarp(vec2 p, float t) {
    vec2 q = vec2(fbm3d(vec3(p, t * 0.1)), fbm3d(vec3(p + vec2(5.2, 1.3), t * 0.1)));
    vec2 r = vec2(fbm3d(vec3(p + 4.0 * q + vec2(1.7, 9.2), t * 0.15)), 
                  fbm3d(vec3(p + 4.0 * q + vec2(8.3, 2.8), t * 0.15)));
    return p + r * 0.8;
}

// Particle field
float particles(vec2 p, float t) {
    float result = 0.0;
    for(int i = 0; i < 12; i++) {
        float fi = float(i);
        vec2 offset = hash22(vec2(fi, fi * 1.3)) * 10.0;
        vec2 pos = offset + vec2(sin(t * 0.3 + fi), cos(t * 0.4 + fi * 1.2)) * 2.0;
        float dist = length(p - pos);
        result += 0.02 / (dist * dist + 0.01);
    }
    return result;
}

// Ripple effect
float ripples(vec2 p, float t) {
    float d = length(p);
    return sin(d * 15.0 - t * 5.0) * exp(-d * 0.5);
}

// Hexagonal tiling
vec2 hexTile(vec2 p) {
    const vec2 s = vec2(1.7320508, 1.0);
    vec2 h = vec2(p.x / s.x, p.y - p.x * 0.5);
    vec2 f = fract(h);
    h -= f;
    float v = mod(h.x + h.y, 3.0);
    if(v < 1.0) {
        if(f.x + f.y > 1.0) h += 1.0;
    } else {
        if(f.x + f.y < 1.0) h -= 1.0;
    }
    return (h + 0.5) * s;
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord.xy / iResolution.xy;
    vec2 tv = uv;
    uv -= 0.5;
    uv.x *= ar;
    
    // Multi-layer time modulation
    float t1 = time;
    float t2 = time * 1.3;
    float t3 = time * 0.7;
    
    // Simplified domain warping
    vec2 p = uv * 3.0;
    
    // Gentle warp
    p = fractalWarp(p, t1);
    
    // Kaleidoscope transformation
    float segments = 6.0;
    p = kaleidoscope(p, segments);
    
    // Gentle rotation
    p *= r2d(t1 * 0.2);
    
    // Core voronoi patterns
    vec3 vor1 = voronoi(p, t1);
    vec3 vor2 = voronoi(p * 2.0 + vec2(5.2, 1.3), t2);
    vec3 vor3 = voronoi(p * 0.5, t3);
    
    // Fractal noise for color variation
    float n = fbm(p, t1);
    
    // Combine patterns
    float pattern = vor1.x * vor2.x + vor3.x;
    pattern = pow(pattern, 0.3);
    
    // Edge detection for borders
    float edge1 = smoothstep(0.0, 0.05, vor1.y);
    float edge2 = smoothstep(0.0, 0.05, vor2.y);
    float edge3 = smoothstep(0.0, 0.05, vor3.y);
    
    // Psychedelic color palette
    vec3 col = vec3(0.);
    
    // Iridescent color waves
    col += 0.5 + 0.5 * cos(6.28 * (pattern * 2.0 + t1 * 0.1 + vec3(0., 0.33, 0.67)));
    col += 0.3 + 0.3 * cos(6.28 * (n + t1 * 0.15 + vec3(0.5, 0.8, 0.2)));
    col += 0.25 + 0.25 * cos(6.28 * (vor1.z * 3.0 + t1 * 0.2 + vec3(0.1, 0.4, 0.7)));
    
    // Iridescent edge glow
    col += vec3(1.0, 0.5, 0.2) * pow(1.0 - vor1.x, 4.0) * 1.5;
    col += vec3(0.2, 0.8, 1.0) * pow(1.0 - vor2.x, 5.0) * 1.2;
    col += vec3(0.8, 0.2, 1.0) * pow(1.0 - vor3.x, 6.0) * 1.0;
    
    // Border highlights
    col += vec3(1.0, 0.8, 0.0) * (1.0 - edge1) * 1.5;
    col += vec3(0.0, 1.0, 0.8) * (1.0 - edge2) * 1.2;
    col += vec3(1.0, 0.0, 0.8) * (1.0 - edge3) * 1.0;
    
    // Color cycling
    col = mix(col, col.zxy, sin(t1 * 0.3) * 0.3 + 0.3);
    
    // Chromatic aberration effect
    vec3 chroma = chromaticAberration(tv, vec2(0.5), length(uv) * 1.5);
    col *= 0.9 + 0.1 * chroma;
    
    // Rainbow shift
    col += 0.2 * vec3(
        sin(t1 * 0.5 + length(uv) * 8.0),
        sin(t1 * 0.5 + length(uv) * 8.0 + 2.09),
        sin(t1 * 0.5 + length(uv) * 8.0 + 4.18)
    );
    
    // Contrast boost
    col = pow(col, vec3(0.8));
    
    // Saturation boost
    float lum = dot(col, vec3(0.299, 0.587, 0.114));
    col = mix(vec3(lum), col, 1.3);
    
    // Vignette
    float vignette = 1.0 - 0.4 * length(uv);
    vignette = pow(vignette, 0.8);
    col *= vignette;
    col *= 0.45;
    // Bloom effect
    col += pow(col, vec3(3.0));
    
    fragColor = vec4(col, 1.0);
}

Image

Not used

More shaders by scry

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

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

Account

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