u/GeologistAvailable71

I built a GPU-driven voxel engine in C++23 with binary greedy meshing and GPU frustum culling
▲ 19 r/VoxelGameDev+1 crossposts

I built a GPU-driven voxel engine in C++23 with binary greedy meshing and GPU frustum culling

Hey all,

I've been working on a voxel engine in my free time for about a year now, and figured it's at a point where it's worth sharing.

The core idea is pushing as much work onto the GPU as possible: a compute shader evaluates chunk visibility every frame, pushes visible cached meshes straight into an indirect draw buffer, and kicks off meshing requests for anything not yet cached (rendered the following frame). Meshes themselves come from a binary greedy meshing algorithm that merges contiguous voxel faces into compressed 2-byte quads, backed by a lock-free VRAM mesh cache with FIFO paging.

Some other bits:

  • AZDO rendering: persistent mapped buffers, multi-draw indirect, DSA
  • Triple-buffered indirect command buffer to avoid CPU/GPU write-read conflicts
  • 3D ring buffer for chunk streaming, only loads incoming planes as the camera crosses chunk boundaries, so it never rebuilds the whole volume
  • Pluggable world generation via a ChunkGeneratorStrategy interface
  • DDA-based voxel ray-casting for voxel picking

https://reddit.com/link/1uo83t0/video/5jdp8nqv4gbh1/player

Status/caveats, to be upfront:

  • This is a solo hobby project, developed on and off (it's not production-grade)
  • There are known bugs, and it may not run correctly under every configuration
  • Some of the test suite currently fails — I haven't gotten to fixing everything yet
  • It's currently NVIDIA-only (uses NvOptimusEnablement to force the dGPU on hybrid laptops); other vendors haven't been tested and may not work

If you're curious about any of the implementation details (meshing, culling, cache design, etc.) Repo's here: https://github.com/omar-owis/VoxelEngine

reddit.com
u/GeologistAvailable71 — 17 hours ago