Digital Nebula

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

Domain-warped fbm noise with hexagonal repetition and electric color palette

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)

// Digital Nebula - Domain-warped fbm with hexagonal tiling
#define PI 3.14159265359

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

// 2D Noise
float noise(vec2 p) {
    vec2 i = floor(p);
    vec2 f = fract(p);
    f = f * f * (3.0 - 2.0 * f);
    
    float a = hash(i);
    float b = hash(i + vec2(1.0, 0.0));
    float c = hash(i + vec2(0.0, 1.0));
    float d = hash(i + vec2(1.0, 1.0));
    
    return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
}

// FBM (fractal Brownian motion)
float fbm(vec2 p) {
    float value = 0.0;
    float amplitude = 0.5;
    float frequency = 1.0;
    
    for(int i = 0; i < 6; i++) {
        value += amplitude * noise(p * frequency);
        amplitude *= 0.5;
        frequency *= 2.0;
    }
    return value;
}

// Hexagonal grid coordinates
vec2 hexGrid(vec2 p) {
    vec2 r = vec2(1.0, 1.732);
    vec2 h = r * 0.5;
    vec2 a = mod(p, r) - h;
    vec2 b = mod(p - h, r) - h;
    return dot(a, a) < dot(b, b) ? a : b;
}

// Domain warp function
vec2 warp(vec2 p, float t) {
    float n1 = fbm(p * 2.0 + t * 0.3);
    float n2 = fbm(p * 2.0 - t * 0.2 + vec2(13.4, 7.8));
    return p + vec2(n1, n2) * 0.5;
}

// Electric palette
vec3 electric(float t) {
    return vec3(
        0.1 + 0.4 * sin(t + 0.0),
        0.3 + 0.5 * sin(t + 2.0),
        0.8 + 0.2 * sin(t + 4.0)
    );
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
    
    // Domain warp the coordinates
    vec2 warped = warp(uv, iTime);
    
    // Hexagonal grid distance
    vec2 hex = hexGrid(warped * 3.0);
    float hexDist = length(hex);
    
    // FBM on the warped domain
    float n = fbm(warped * 3.0 + iTime * 0.1);
    
    // Create layers
    float pattern = sin(hexDist * 8.0 - iTime + n * 4.0) * 0.5 + 0.5;
    
    // Electric color palette based on position and time
    float colorPhase = pattern * 2.0 + iTime * 0.5 + length(uv);
    vec3 col = electric(colorPhase);
    
    // Add glow from hex centers
    float glow = exp(-hexDist * 3.0) * 0.5;
    col += vec3(0.5, 0.8, 1.0) * glow;
    
    // Vignette
    float vignette = 1.0 - length(uv) * 0.5;
    col *= vignette;
    
    // Boost intensity
    col *= 1.5;
    
    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