Project_2026-02-12_17-00-28

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)

// --- THE QUANTUM GEL-CAPSULE FIELD ---
// NEAT / TOUCHABLE / STABLE
// LOOKS LIKE LIQUID BUTTONS

#define GRID_SIZE 8.0
#define SOFTNESS 0.2
#define GLOSS 32.0

// 1. THE GEL PALETTE (Translucent & Edible)
// Deep Berry -> Cyan -> White
vec3 gel_palette(float t) {
    vec3 a = vec3(0.5, 0.5, 0.5);
    vec3 b = vec3(0.5, 0.5, 0.5);
    vec3 c = vec3(1.0, 1.0, 1.0);
    vec3 d = vec3(0.3, 0.20, 0.20);
    return a + b * cos(6.28318 * (c * t + d + iTime * 0.1));
}

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

    // A. CREATE THE NEAT GRID (Fast & Cheap)
    uv *= GRID_SIZE;
    vec2 id = floor(uv);
    vec2 gv = fract(uv) - 0.5;
    
    // B. MAKE THE PILLOW SHAPE
    // Distance from center of each tile
    float d = length(gv);
    
    // "Pillow" height map (Fake 3D)
    // 1.0 at center, 0.0 at edges
    float height = smoothstep(0.5, 0.3, d);
    
    // C. THE TOUCHABLE TEXTURE (Internal Liquid)
    // Ripples *inside* the gel capsule
    float ripples = sin(d * 20.0 - iTime * 2.0);
    float texture_val = ripples * 0.1 * height;
    
    // D. COLORING
    // Base color varies by tile ID (The "Neat" pattern)
    float tile_noise = fract(sin(dot(id, vec2(12.98, 78.23))) * 43758.54);
    vec3 col = gel_palette(tile_noise + height * 0.5);
    
    // E. LIGHTING (The "Wet" Look)
    // 1. Inner Glow (Subsurface Scattering)
    col += gel_palette(height) * height * 0.5;
    
    // 2. Hard Specular (The Shiny Plastic Surface)
    // We fake a light source coming from top-right
    vec2 light_dir = normalize(vec2(1.0, 1.0));
    // Calculate simple "slope" of the pillow
    vec3 normal = normalize(vec3(gv, 0.2)); 
    float light = max(dot(normal, vec3(light_dir, 0.5)), 0.0);
    float spec = pow(light, GLOSS);
    
    // Add the shine only on the high parts
    col += vec3(1.0) * spec * height;
    
    // F. EDGES (The "Neat" Separation)
    // Darken the gaps between pills
    col *= smoothstep(0.5, 0.4, d);

    // G. POST-PROCESS
    col = pow(col, vec3(0.4545)); // Gamma
    col *= 1.2 - length(uv0) * 0.5; // Vignette

    fragColor = vec4(col, 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