Sherbert Lava

GLSL shader by merrypranxter · created 2026-02-12 · 10s loop · 2 passes

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)

// --- 1. THE DEFINES (MAXIMUM INTENSITY) ---
#define LAYERS 10.0      // EXTREME INTRICACY (The "Little Textures")
#define SPEED iTime * 0.5
#define SCALE 3.0        // ZOOM LEVEL
#define STATIC_GRAIN 1.0 // HOW "GRITTY" THE TEXTURE IS

// --- 2. THE MATH ENGINE (THE GLITCH GENERATOR) ---

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

// HIGH-QUALITY RANDOM NOISE (THE DIGITAL SAND)
float hash(vec2 p) {
    p = fract(p * vec2(123.34, 456.21));
    p += dot(p, p + 45.32);
    return fract(p.x * p.y);
}

// THE NOISE FUNCTION (VALUE NOISE FOR SMOOTH GLITCH)
float noise(vec2 p) {
    vec2 i = floor(p);
    vec2 f = fract(p);
    f = f * f * (3.0 - 2.0 * f);
    float a = hash(i);
    float b = hash(i + vec2(1.0, 0.0));
    float c = hash(i + vec2(0.0, 1.0));
    float d = hash(i + vec2(1.0, 1.0));
    return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
}

// THE FRACTAL TEXTURE (THE "FEELS" LOOK)
// We pile layers of noise on top of each other to create the "Intricate Details"
float fbm(vec2 p) {
    float v = 0.0;
    float a = 0.5;
    mat2 m = rot(1.5); // Rotate each layer to create the "Swirl"
    for (float i = 0.0; i < LAYERS; i++) {
        v += a * noise(p);
        p = m * p * 2.0; // DOUBLE THE FREQUENCY EACH TIME (The "Tiny Details")
        a *= 0.5;
    }
    return v;
}

// --- 3. THE RENDERER (RADIOACTIVE CANDY) ---

void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
    // 1. Normalize
    vec2 uv = (fragCoord * 2.0 - iResolution.xy) / iResolution.y;
    vec2 uv0 = uv;
    
    // 2. DOMAIN WARPING (THE LIQUID GLITCH)
    // We distort the UVs with the noise function itself!
    vec2 q = vec2(0.0);
    q.x = fbm(uv + vec2(0.0, 0.0) + SPEED * 0.1);
    q.y = fbm(uv + vec2(5.2, 1.3) + SPEED * 0.1);

    vec2 r = vec2(0.0);
    r.x = fbm(uv + 4.0 * q + vec2(1.7, 9.2) + 0.15 * iTime);
    r.y = fbm(uv + 4.0 * q + vec2(8.3, 2.8) + 0.126 * iTime);

    // The final "Height Map" of the texture
    float f = fbm(uv + 4.0 * r);

    // 3. THE COLOR PALETTE (STRICTLY NEON)
    // NO BROWNS ALLOWED. ONLY HIGH ENERGY.
    vec3 col = vec3(0.0);
    
    // Mix 1: Deep Violet to Hot Pink
    vec3 c1 = mix(vec3(0.1, 0.0, 0.2), vec3(1.0, 0.05, 0.5), clamp(f * f * 4.0, 0.0, 1.0));
    
    // Mix 2: Add Acid Yellow and Cyan highlights
    vec3 c2 = mix(vec3(0.0, 1.0, 1.0), vec3(1.0, 1.0, 0.0), clamp(length(q), 0.0, 1.0));
    
    // Combine them based on the texture height
    col = mix(c1, c2, f);

    // 4. THE STATIC GRAIN (THE FEELS GRIT)
    // This adds that "sand" look from the video
    float static_noise = hash(uv * 1000.0 + iTime);
    col += (static_noise - 0.5) * 0.3; // Add grain
    
    // 5. THE SPARKLE (INTENSE TEXTURE)
    // Sharpen the ridges so they look like tiny glowing wires
    float ridges = pow(f, 3.0); 
    col += vec3(1.0, 0.0, 0.8) * ridges * 2.0; // Hot Pink Glow

    // 6. FINAL CRUNCH (KILL THE NEUTRALS)
    col = pow(col, vec3(1.2)); // Deepen the contrast
    col *= 1.5; // BOOST BRIGHTNESS

    fragColor = vec4(clamp(col, 0.0, 1.0), 1.0);
}

Image

Not used

More shaders by merrypranxter

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

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

Account

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