Pulsar Core

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

Radial starburst with rotating elliptical rings, radial rays, spiral arms and lens flare effects.

Tags: 2D, Space, Star, Pulsar, Cosmic

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)

// Pulsar Core - Radial starburst with rotating rings and lens flare
// Cosmic lighthouse effect

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
    float t = iTime * 0.5;
    
    vec3 col = vec3(0.02, 0.03, 0.06);
    
    // Distance from center
    float r = length(uv);
    float angle = atan(uv.y, uv.x);
    
    // Central pulsar glow
    float coreGlow = 1.0 / (1.0 + r * r * 8.0);
    col += vec3(1.0, 0.8, 0.5) * coreGlow * 2.0;
    
    // Rotating rings
    for(int i = 0; i < 5; i++) {
        float fi = float(i) + 1.0;
        float ringR = 0.1 + fi * 0.15;
        float ringWidth = 0.02 * fi;
        float rotation = t * (0.5 + fi * 0.2);
        
        // Elliptical ring
        float ringAngle = angle + rotation;
        vec2 ringUV = vec2(cos(ringAngle), sin(ringAngle) * 0.3);
        float ringDist = length(uv - ringUV * ringR);
        float ring = smoothstep(ringWidth, 0.0, abs(ringDist - ringWidth * 0.5));
        
        vec3 ringCol = 0.5 + 0.5 * cos(vec3(0.0, 2.09, 4.18) + fi * 0.7);
        col += ringCol * ring * 0.3;
    }
    
    // Radial rays/starburst
    float numRays = 16.0;
    float rayAngle = mod(angle + t * 0.3, 6.28318 / numRays);
    float rays = pow(sin(rayAngle * numRays * 0.5), 4.0);
    rays *= smoothstep(0.0, 0.8, 1.0 - r); // Fade toward edge
    col += vec3(1.0, 0.9, 0.7) * rays * coreGlow * 1.5;
    
    // Spiral arms
    float spiral = sin(angle * 3.0 + r * 10.0 - t * 2.0);
    float spiralMask = smoothstep(0.0, 0.3, spiral) * smoothstep(0.8, 0.0, r);
    col += vec3(0.3, 0.6, 1.0) * spiralMask * 0.2;
    
    // Central hot spot
    col += vec3(1.0, 0.95, 0.9) * smoothstep(0.15, 0.0, r) * 3.0;
    
    // Lens flare / corona spikes
    float spikes = sin(angle * 8.0 + t) * sin(angle * 13.0 - t * 0.7);
    spikes = smoothstep(0.6, 1.0, spikes) * smoothstep(0.0, 0.5, r) * smoothstep(0.7, 0.0, r);
    col += vec3(0.8, 0.9, 1.0) * spikes * 0.5;
    
    // Dust/background stars
    float starNoise = fract(sin(dot(uv * 80.0, vec2(12.9898, 78.233))) * 43758.5453);
    if(starNoise > 0.96) {
        col += vec3(0.9) * (starNoise - 0.96) * 25.0;
    }
    
    // Vignette
    col *= 1.0 - r * 0.15;
    
    // Tone map
    col = col / (1.0 + col * 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