The Challenge
After discovering a video about the DDA ray traversal technique for rendering voxels at high framerates, I learned the creator was planning a follow-up on implementing octrees to render trillions of voxels at 100+ fps. This became the foundation for my research into optimizing voxel rendering performance.
Building on the original implementation, I explored various optimization strategies over the course of a month, iterating through different spatial data structures and GPU compute approaches in Vulkan.
Development
Most of the month was debugging. These artifacts showed up along the way, each one pointing at a ray traversal edge case or a spatial indexing mistake.












The breakthrough
Traditional octrees barely helped. After a lot of profiling the bottleneck was clear: GPUs handle recursion and stack operations poorly. Each ray walked millions of voxels at O(n), and the recursion overhead ate any benefit the octree was supposed to give.
The fix was to drop recursion entirely and use a flattened, hard-coded layer hierarchy. This "pseudo-octree" keeps the spatial subdivision but removes the stack:
- Layer 1: Voxel (1 bit of storage)
- Layer 2: Brick (8³ = 512 voxels)
- Layer 3: Coarse grid (16³ = 4,096 bricks)
- Layer 4: Chunk (16³ = 4,096 coarse grids)
That took traversal from O(n) to O(log n) and cleared the bottleneck. Each extra layer scales exponentially, which is what makes trillion-voxel scenes tractable.
Results




Final benchmarks
- 1 trillion voxels at 120+ fps
- 8 trillion voxels at 30+ fps
- 4-5 GB total VRAM and RAM
- O(log n) ray traversal
Notes
This builds directly on the original implementation. I used Claude Code to speed up the Rust and Vulkan plumbing so I could spend the time on the architecture and the algorithm itself.
Worth a look: the original repo and the DDA paper that started it.