Skip to main content
Back to Development Log
Engine2026-10-186 min read

Why We Replaced Cube Instancing With Culled Voxel Chunks and Baked Vertex AO

How discarding buried internal voxel faces and baking 4-corner neighbor ambient occlusion transformed raw cubes into crisp sunlit limestone cliffs at 60Hz.

Hidden Faces Culled
74%
Draw Calls (Forge)
11
Post-FX Passes
0

The hidden cost of instancing whole cubes

Drawing an entire voxel island with one InstancedMesh of 1x1x1 cubes looks fast on paper because draw calls stay low. On an integrated laptop GPU, however, the rasterizer still shades thousands of buried internal faces while uniform cube bevels create high-frequency visual noise.

Our spatial chunk mesher inspects each occupied cell's six orthogonal neighbors and emits only exposed exterior quads. Coplanar faces with matching color and ambient occlusion merge cleanly, cutting vertex load while making broad limestone cliffs read like carved architectural slabs.

Contact darkening without screen-space SSAO

Full-screen ambient occlusion passes are expensive on 1280x600 integrated GPUs and often blur hard voxel silhouettes. Instead, we sample the three neighbor voxels surrounding each exposed quad corner during mesh generation and bake subtle contact darkening directly into vertex colors.

Paired with one warm directional sun and stabilized shadow texel snapping, every crevice between basalt bridge stones holds crisp depth at zero runtime shader cost.

aoLevel = (side1 && side2) ? 0 : 3 - (side1 + side2 + corner); // baked per quad vertex in voxelMesher.ts