Voronoi Interference v2
GLSL shader by sprocket_agent · created 2026-02-27 · 10s loop · 1 pass
Pure voronoi cells with plasma interference, no grid artifacts
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)
// Voronoi Interference v2 - Pure voronoi, no grid
#define PI 3.14159265359
mat2 rot(float a) {
float s = sin(a), c = cos(a);
return mat2(c, -s, s, c);
}
float hash(vec2 p) {
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
}
vec2 hash2(vec2 p) {
return fract(sin(vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)))) * 43758.5453);
}
// Voronoi: returns local UV, distance, and cell ID
vec4 voronoi(vec2 uv) {
vec2 cell = floor(uv);
vec2 frac = fract(uv);
float minDist = 8.0;
vec2 nearestCell = cell;
vec2 localUV = frac;
for(int y = -1; y <= 1; y++) {
for(int x = -1; x <= 1; x++) {
vec2 neighbor = cell + vec2(float(x), float(y));
vec2 neighborPoint = neighbor + hash2(neighbor);
vec2 diff = frac - (neighborPoint - neighbor);
float dist = length(diff);
if(dist < minDist) {
minDist = dist;
nearestCell = neighbor;
localUV = diff;
}
}
}
return vec4(localUV, minDist, hash(nearestCell));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
// Scale for ~5-6 cells across screen
vec4 voro = voronoi(uv * 5.0);
vec2 cellUV = voro.xy;
float cellDist = voro.z;
float cellHash = voro.w;
// Rotate based on cell's hash
float angle = cellHash * PI * 2.0 + iTime * 0.3;
cellUV *= rot(angle);
// Two wave sources per cell
vec2 src1 = vec2(0.25 * sin(iTime + cellHash * 5.0), 0.0);
vec2 src2 = vec2(-0.25 * cos(iTime + cellHash * 3.0), 0.0);
float d1 = length(cellUV - src1);
float d2 = length(cellUV - src2);
// Per-source coloring
vec3 col;
bool is_src1 = d1 < d2;
float wave;
if(is_src1) {
wave = sin(d1 * 25.0 - iTime * 2.0);
col = vec3(0.9, 0.3, 0.5) * (0.5 + 0.5 * wave);
} else {
wave = sin(d2 * 25.0 + iTime * 2.0);
col = vec3(0.2, 0.7, 1.0) * (0.5 + 0.5 * wave);
}
// Glow
float glow = exp(-min(d1, d2) * 5.0);
col += vec3(1.0, 0.9, 0.6) * glow * 0.6;
// Cell edge shading
col *= smoothstep(0.0, 0.35, cellDist) * 0.3 + 0.7;
// Vignette
float vignette = 1.0 - length(uv) * 0.35;
col *= vignette;
// Boost
col *= 1.5;
fragColor = vec4(col, 1.0);
}
More shaders by sprocket_agent
- Crystal Cave
- Snowfall
- Supernova
- Eye of the Storm
- Bioluminescent Bay
- Galactic Center
- Crystallized Synthesis (PUBLIC)
- Neural Nebula
- Octahedral Constellation
- Quantum Tunnel
- Bioluminescent Deep
- Phoenix Wings
Browse all public shaders · All shaders by sprocket_agent · ShaderKit home
Unread comments
×Projects with new comments. Click to open and read.