TRASHCADE
Aug 28, 2026By Grid Hacker6 min read

VOXEL-LIFE 3D: Simulating 26-Neighbor 3D Conway Life and Hardware Instanced Crystals in WebGL

"How to scale Conway Game of Life into the third dimension: 26-neighbor Moore kernels, Carter Bays 3D stability math, GPU hardware cube instancing, and generation micro-pop sonification."

VOXEL-LIFE 3D: Simulating 26-Neighbor 3D Conway Life and Hardware Instanced Crystals in WebGL
ARCHIVE RECORD #SCALING-3D-CELLULAR-AUTOMATA-GLSL
#WebGL2#Cellular Automata#3D Math#Voxel Engine#Web Audio API#GPU Instancing
🎹 Associated Audio Lab
VOXEL-LIFE 3D
3D Cellular Automata & Volumetric Crystal Lab
LAUNCH AUDIO LAB NOW ➔

01.Escape from Flatland: The Dimensional Leap

In standard 2D Conway's Game of Life, a cell sits on a flat grid surrounded by 8 neighbors (the 2D Moore neighborhood). With the classic rule of Survival on 2-3 neighbors and Birth on 3, you get stable oscillators, glider guns, and Turing-complete computational structures.

When you take cellular automata into 3D, a single voxel is bounded by a 3x3x3 volume of 26 immediate neighbors (3^3 - 1 = 26).

If you blindly apply 2D rules to 3D space, the universe instantly explodes into solid blocks or collapses into total void extinction. Because a cell has over three times as many neighbors, finding the delicate boundary between static death and runaway chaos requires entirely different mathematical balance.

02.1. The Carter Bays 3D Life Theorems & Density Dynamics

In 1987, computer scientist Carter Bays published pioneering research examining which 3D neighbor combinations sustain life without instantly dying of underpopulation or exploding into solid cubes:

  • 🌋 Pyroclastic Coral (S4-5 / B5): A self-sustaining growth engine. The low birth threshold (B=5) allows loose random seeds to continuously expand into branching dendritic coral towers.
  • 🧬 Carter Bays 5655 (S5-6 / B5): A balanced organic 3D life rule that fosters continuous wave motion, gliders, and rich oscillations.
  • 🔬 Bays 5766 (S5-7 / B6 - Conservative): The mathematically purest 3D analogue to 2D Conway Life. Because birth strictly requires 6 exact neighbors, random sparse soups rapidly die out from underpopulation (< 5 neighbors). It requires a dense central cluster seed or specific polycube glider structures to flourish.
  • 💎 Crystalline Lattice (S4 / B5): Forms rigid cybernetic architecture and symmetric floating cubical monoliths.
  • 🧫 Amoeba Organism (S5-8 / B6-7): Yields pulsating fluid membranes that merge, split, and engulf volumes.

03.2. Zero-Overhead Hardware Voxel Instancing

Simulating a 36x36x36 grid means managing 46,656 individual 3D voxels. If you attempt to allocate three.js mesh objects or rebuild vertex arrays on the CPU every generation, the browser's JavaScript garbage collector chokes and frame rates plummet below 10 FPS.

In VOXEL-LIFE 3D, we bypass scene graph overhead by utilizing pure WebGL2 hardware instancing:

  1. 1.
    Static Geometry Buffer: A single 36-vertex unit cube with pre-computed face normals is uploaded to VRAM once during initialization.
  2. 2.
    Dynamic Instanced Buffer: Every frame, active living voxel coordinates and longevity ages (x, y, z, age) are packed into a single continuous Float32Array and streamed via gl.bufferSubData.
  3. 3.
    Hardware Divisor: We enable gl.vertexAttribDivisor(2, 1), instructing the GPU to draw thousands of glowing cubes in a single draw call with full per-face directional lighting and ambient occlusion.

04.3. Acoustic Generation Pops & Equilibrium Detection

To provide immediate tactile feedback without audio fatigue, VOXEL-LIFE 3D synthesizes dynamic per-generation micro-pops in Web Audio:

  • Dynamic Density Pitching: Each step calculates the active voxel population ratio and scales the sine pulse pitch from 520Hz up to 1.2kHz. Denser universes produce higher, tighter acoustic blips.
  • Volume Scaled by Cellular Delta: Steps with hundreds of births and deaths produce fuller clicks, while small oscillations remain subtle and gentle.
  • Still-Life Equilibrium Freezing: The simulation diffs the current and previous double-buffered grids. If total changes reach zero (static equilibrium) or the population drops to zero (extinction), the generation counter locks in place with a [STABLE] or [EXTINCT] badge, preserving the exact generation count at which the colony stabilized.