Sacred Spiral

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

Golden ratio spiral with Fibonacci geometry and nested patterns.

Tags: 2D, Geometry, Sacred, Mathematical

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)

// Sacred Spiral - Golden ratio spiral with nested geometry
// Mathematical harmony visualized

#define PHI 1.61803398875
#define PI 3.14159265

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

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
    float t = iTime * 0.15;
    
    vec3 col = vec3(0.03, 0.02, 0.04);
    
    // Polar coordinates
    float r = length(uv);
    float a = atan(uv.y, uv.x);
    
    // Golden spiral: r = a * e^(b*theta)
    // Where b = ln(phi)/(pi/2) for 90 degree growth
    float b = log(PHI) / (PI * 0.5);
    
    // Multiple spirals rotating
    for(int i = 0; i < 5; i++) {
        float fi = float(i);
        float spiralR = 0.1 * exp(b * (a + t * (1.0 + fi * 0.2) + fi * PI * 0.4));
        
        // Distance to spiral arm
        float spiral = smoothstep(0.03, 0.0, abs(r - spiralR));
        
        // Golden ratio color progression
        vec3 spiralCol = 0.5 + 0.5 * cos(vec3(0.0, 0.5, 1.0) * 6.28 + fi * 0.618 + t);
        col += spiralCol * spiral * 0.8;
    }
    
    // Fibonacci squares (approximated as rings)
    float fib[8] = float[](1.0, 1.0, 2.0, 3.0, 5.0, 8.0, 13.0, 21.0);
    float scale = 0.02;
    for(int i = 0; i < 8; i++) {
        float ringR = fib[i] * scale;
        float ring = smoothstep(0.01, 0.0, abs(r - ringR));
        col += vec3(0.9, 0.7, 0.4) * ring * 0.5;
    }
    
    // Central flower pattern
    float petals = 8.0;
    float flower = sin(a * petals + r * 10.0 - t * 2.0) * 0.5 + 0.5;
    flower *= smoothstep(0.5, 0.0, r);
    col += vec3(1.0, 0.5, 0.7) * flower * 0.4;
    
    // Radial energy lines
    for(int i = 0; i < 12; i++) {
        float angle = float(i) * PI / 6.0 + t * 0.5;
        float line = smoothstep(0.02, 0.0, abs(sin(a - angle) * r));
        line *= smoothstep(0.0, 0.3, r) * smoothstep(0.6, 0.3, r);
        col += vec3(0.8, 0.9, 1.0) * line * 0.4;
    }
    
    // Central glow
    col += vec3(1.0, 0.9, 0.7) / (1.0 + r * 10.0) * 0.5;
    
    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