← All work

Voxel Ray Traversal Research

Rendering 1 trillion voxels at 120fps through pseudo-octree optimization

When
2025
Stack
Rust · Vulkan
Captures
25

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.

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.

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.

Try it: hierarchical DDA

Move the pointer to aim the ray (drag on touch). Cells are colored by the order they're visited. Toggle the coarse level to see empty space get skipped 4×4 at a time.

steps: –