Project_2026-02-13_23-27-19

GLSL shader by scry · created 2026-02-14 · 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 sdBox(in vec2 p, in vec2 b) {
    vec2 d = abs(p)-b;
    return length(max(d,0.0)) + min(max(d.x,d.y),0.0);
}

float chebyshev(vec2 p) {
    return max(abs(p.x), abs(p.y));
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord.xy / iResolution.xy;
    uv -= 0.5;
    uv.x *= ar;
    
    // Scale up so we see multiple rings
    uv *= 6.0;
    
    // Animate rotation over time
    //uv *= r2d(time);
    
    vec3 col = vec3(0.);
    //uv = abs(uv)-1.5;
    //uv *= r2d(deg*45.);
    // Chebyshev distance gives square-shaped rings
    uv.x -= 0.33;
    uv.x += step(uv.y,0.)/1.;
    float d = chebyshev(uv);
    
    // Which ring are we in
    float ring = floor(d);
    
    // Fractional position within the ring
    float f = fract(d);
    
    // Angle around center
    float angle = atan(uv.y, uv.x);
    
    // Shift alternate rings by half a turn to create spiral connectivity
    // Each ring offsets the angle by pi, creating a continuous spiral
    //angle += ring * pi;
    
    // Normalize angle to [0,1)
    float a = fract(angle / (2.0 * pi));
    
    // Create spiral: combine ring distance with angle
    float spiral = fract(f);
    
    // Draw lines at the spiral boundary
    float line = smoothstep(0.02, 0.0, abs(spiral - 0.5) - 0.25);
    
    col = vec3(line)*0.5;
    //col += a;
    
    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