Aurora Waves

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

Multi-layered Perlin noise aurora borealis with flowing curtain effects and starfield.

Tags: 2D, Aurora, Noise, Nature

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)

// Aurora Waves - Layered aurora borealis simulation
// Multiple perlin noise layers with aurora palette

// Simplex noise 2D
vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
vec2 mod289(vec2 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
vec3 permute(vec3 x) { return mod289(((x*34.0)+1.0)*x); }

float snoise(vec2 v) {
    const vec4 C = vec4(0.211324865405187, 0.366025403784439,
                        -0.577350269189626, 0.024390243902439);
    vec2 i  = floor(v + dot(v, C.yy));
    vec2 x0 = v - i + dot(i, C.xx);
    vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
    vec4 x12 = x0.xyxy + C.xxzz;
    x12.xy -= i1;
    i = mod289(i);
    vec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0))
                            + i.x + vec3(0.0, i1.x, 1.0));
    vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy),
                            dot(x12.zw,x12.zw)), 0.0);
    m = m*m; m = m*m;
    vec3 x = 2.0 * fract(p * C.www) - 1.0;
    vec3 h = abs(x) - 0.5;
    vec3 ox = floor(x + 0.5);
    vec3 a0 = x - ox;
    m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);
    vec3 g;
    g.x = a0.x * x0.x + h.x * x0.y;
    g.yz = a0.yz * x12.xz + h.yz * x12.yw;
    return 130.0 * dot(m, g);
}

// Aurora palette: green dominant, pink/blue accents
vec3 aurora_color(float v, float t) {
    return vec3(
        0.2 + 0.5 * sin(v * 1.5 + t * 0.5),
        0.6 + 0.4 * sin(v * 2.0 + t * 0.3),
        0.4 + 0.5 * sin(v * 1.8 + t * 0.4 + 2.0)
    );
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
    float t = iTime * 0.15;
    
    // Multi-layered noise for aurora curtains
    float aur = 0.0;
    
    // Layer 1: base movement
    float n1 = snoise(vec2(uv.x * 2.0 + t * 0.5, uv.y * 1.5));
    aur += smoothstep(0.0, 0.8, n1) * 0.4;
    
    // Layer 2: flowing waves
    float n2 = snoise(vec2(uv.x * 3.0 - t * 0.3, uv.y * 2.0 + t * 0.2));
    aur += smoothstep(0.1, 0.9, n2) * 0.3;
    
    // Layer 3: fine detail
    float n3 = snoise(vec2(uv.x * 5.0 + t * 0.1, uv.y * 3.0));
    aur += smoothstep(0.2, 0.7, n3) * 0.2;
    
    // Vertical curtain shaping
    float curtain = sin(uv.x * 3.0 + t) * 0.3 + 0.7;
    curtain *= smoothstep(-1.5, 0.0, uv.y) * smoothstep(1.5, 0.3, uv.y);
    aur *= curtain;
    
    // Color based on height and intensity
    vec3 col = aurora_color(aur + uv.y, t) * aur;
    
    // Vertical gradient shift (green low, pink/blue high)
    col.g *= 1.0 + smoothstep(0.0, -0.5, uv.y) * 0.5;
    col.rb *= 1.0 + smoothstep(-0.3, 0.3, uv.y) * 0.3;
    
    // Add stars
    float star = snoise(uv * 50.0);
    if (star > 0.96) {
        col += vec3(0.8, 0.9, 1.0) * (star - 0.96) * 25.0;
    }
    
    // Background sky gradient (night)
    vec3 sky = mix(vec3(0.02, 0.03, 0.08), vec3(0.05, 0.06, 0.12), uv.y * 0.5 + 0.5);
    col += sky * (1.0 - aur * 0.5);
    
    // Vignette
    col *= 1.0 - length(uv) * 0.25;
    
    // Boost and tone map
    col *= 1.5;
    col = col / (1.0 + col * 0.4);
    
    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