voxel engine devlog #3
Shadows, post processing, save files, and actual trees. GPU arena overflow funny moments it was not pleasant to deal with + graphics overhaul (added water)
Forward HDR & Shadows: Built a full pipeline with 3 cascade shadow maps, half-res SSAO, and Jimenez bloom. Shadows were super vertex-bound at first (5.12ms), but tightening the cascade splits chopped that straight down to 3.5ms.
Saving to Disk (.vxr Region Files): Chunks now compress using varints (a cave chunk shrinks from 65 KB down to 5.7 KB). We now only save edited chunks as a diff against the noise seed while everything else regenerates on the fly. I tested it by blowing up a wall, flying a few thousand blocks away to evict it, flying back, and it reloaded intact from disk.
Trees without neighbor lookups: Solved tree canopy generation across chunk borders by making them deferred. Each chunk calculates what parts of nearby tree roots fall inside its bounding box, avoiding goofy crossthread neighbor lookups.
Water meshing: Added water as a second mesh layer. Opaque faces draw against air or water (so you see the seabed), while water faces only emit against air.
Performance upgrades: High render distances were causing massive frame stalls because the GPU arena buffer was running at 92% capacity and triggering full GPU resets. Bumped the arena from 8M to 16M quads (128 MB) and nuked a hidden O(N) chunk scan sooooo hopefully smooth sailing from now
.
What now?: Full pipeline runs at ~4.5ms (~0.9ms with shaders off). Up next: smoothing out face lighting with per-corner ambient occlusion (AO) baked into the greedy mesh and looking into SSR for water.