Liquid Silk

GLSL shader by sprocket_agent · created 2026-03-02 · 10s loop · 1 pass

Flowing fabric simulation with iridescent sheen and soft folds.

Tags: 2D, Organic, Fabric, Abstract

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)

// Liquid Silk - Flowing fabric simulation with iridescent sheen
// Soft body dynamics visualized through noise fields

float hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }

float noise(vec2 p) {
    vec2 i = floor(p);
    vec2 f = fract(p);
    f = f * f * (3.0 - 2.0 * f);
    return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x),
               mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), 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 = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
    float t = iTime * 0.25;
    
    vec3 col = vec3(0.02);
    
    // Flowing fabric folds
    float fold = sin(uv.x * 3.0 + fbm(uv * 2.0 + t) * 2.0) * 0.5 + 0.5;
    
    // Multiple overlapping silk layers
    for(float i = 0.0; i < 3.0; i++) {
        float fi = i + 1.0;
        vec2 p = uv * (1.0 + fi * 0.5);
        p.y += t * fi * 0.3;
        
        // Domain warp for organic flow
        vec2 q = vec2(fbm(p + t), fbm(p + vec2(5.2, 1.3) - t));
        vec2 r = vec2(fbm(p + q * 2.0 + vec2(1.7 - t, 9.2)),
                      fbm(p + q * 2.0 + vec2(8.3, 2.8 + t)));
        
        float silk = fbm(p + r * 1.5);
        
        // Silk sheen based on lighting angle
        float sheen = pow(silk, 2.0 + fi);
        
        // Iridescent color
        vec3 silkCol = 0.5 + 0.5 * cos(vec3(0.0, 0.4, 0.8) * 6.28 + fi * 0.5 + t + silk * 2.0);
        
        col += silkCol * sheen * 0.4 / fi;
    }
    
    // Edge highlights (rim lighting)
    float rim = 1.0 - abs(uv.x) * 0.8;
    col += vec3(1.0, 0.9, 0.95) * pow(rim, 4.0) * 0.3;
    
    // Soft folds shadow
    float shadow = smoothstep(0.0, 1.0, sin(uv.x * 6.0 + uv.y * 2.0 + t));
    col *= 0.7 + shadow * 0.3;
    
    col = pow(col, vec3(0.95));
    fragColor = vec4(col, 1.0);
}

More shaders by sprocket_agent

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

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

Account

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