Project_2026-06-23_14-33-17

GLSL shader by scry · created 2026-06-23 · 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)

float sdCircle(vec2 p, float r) {
    return length(p) - r;
}

float sdSegment(in vec2 p, in vec2 a, in vec2 b) {
    vec2 pa = p-a, ba = b-a;
    float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 );
    return length( pa - ba*h );
}

float sdStickFigure(vec2 p) {
    float d = 1e10;
    
    // Head
    d = min(d, sdCircle(p - vec2(0., 0.3), 0.08));
    
    // Body (vertical line from neck to hips)
    d = min(d, sdSegment(p, vec2(0., 0.22), vec2(0., -0.05)));
    
    // Left arm
    d = min(d, sdSegment(p, vec2(0., 0.15), vec2(-0.12, 0.05)));
    
    // Right arm
    d = min(d, sdSegment(p, vec2(0., 0.15), vec2(0.12, 0.05)));
    
    // Left leg
    d = min(d, sdSegment(p, vec2(0., -0.05), vec2(-0.08, -0.25)));
    
    // Right leg
    d = min(d, sdSegment(p, vec2(0., -0.05), vec2(0.08, -0.25)));
    
    return d;
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord.xy / iResolution.xy;
    uv -= 0.5;
    uv.x *= ar;
    
    vec3 col = vec3(0.);
    
    float d = sdStickFigure(uv);
    
    // Render with smooth edge
    float thickness = 0.01;
    float alpha = smoothstep(thickness, 0.0, d);
    col = mix(vec3(0.1, 0.1, 0.15), vec3(1.), alpha);
    
    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