Grid Interference

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

Repetitive grid cells with internal plasma interference patterns

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)

// Grid Interference - Repetitive cells with plasma waves
#define PI 3.14159265359

// Rotation matrix
mat2 rot(float a) {
    float s = sin(a), c = cos(a);
    return mat2(c, -s, s, c);
}

// 2D hash
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;
    
    // Grid repetition (4x4)
    vec2 gridUV = uv * 4.0;
    vec2 cellID = floor(gridUV);
    vec2 cellUV = fract(gridUV) - 0.5;
    
    // Rotate each cell differently based on ID
    float angle = hash(cellID) * PI * 2.0 + iTime * 0.5;
    cellUV *= rot(angle);
    
    // Distance from cell center
    float d = length(cellUV);
    
    // Two wave sources per cell
    vec2 src1 = vec2(0.3 * sin(iTime + hash(cellID) * 3.0), 0.0);
    vec2 src2 = vec2(-0.3 * cos(iTime + hash(cellID + 1.0) * 3.0), 0.0);
    
    float d1 = length(cellUV - src1);
    float d2 = length(cellUV - src2);
    
    // Per-source coloring (crystallized rule: min + color-by-source)
    vec3 col;
    bool is_src1 = d1 < d2;
    float wave;
    
    if(is_src1) {
        wave = sin(d1 * 20.0 - iTime * 2.0);
        col = vec3(0.8, 0.2, 0.4) * (0.5 + 0.5 * wave); // Pink/orange
    } else {
        wave = sin(d2 * 20.0 + iTime * 2.0);
        col = vec3(0.2, 0.6, 0.9) * (0.5 + 0.5 * wave); // Blue/cyan
    }
    
    // Glow from nearest source
    float glow = exp(-min(d1, d2) * 4.0);
    col += vec3(1.0, 0.8, 0.5) * glow * 0.5;
    
    // Cell border
    float border = max(abs(cellUV.x), abs(cellUV.y));
    col *= smoothstep(0.48, 0.45, border) * 0.3 + 0.7;
    
    // Global vignette
    float vignette = 1.0 - length(uv) * 0.4;
    col *= vignette;
    
    // Boost
    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