Rendering images via raycasting, be it on the CPU or GPU, is a powerful method, especially when it comes to voxels.

Motivation

TODO: Why raytrace voxels?

History

In 1987, a paper called A Fast Voxel Traversal Algorithm for Ray Tracing1 was published by Amanatides and Woo that, as the name implies, paved the way for fast voxel raytracing:

Abstract: A fast and simple voxel traversal algorithm through a 3D space partition is introduced. Going from one voxel to its neighbour requires only two floating point comparisons and one floating point addition. Also, multiple ray intersections with objects that are in more than one voxel are eliminated.

TODO: More history? Necessary?

Implementation

To initially implement voxel raytracing, you will want to look at the aforementioned Fast Voxel Traversal paper1 (see raycasting), which forms the basis (!) for most other algorithms and architectures.

For very basic & small voxel scenes (below say, ~128^3), this may already be enough. But it's never enough, is it?

After that comes accelerating ray-traversal and reducing memory consumption, the key to both of which is sparsity: If an area of voxels consists of the same type/value of voxels, it should be possible to both compress it's memory representation and, if the area is 'empty', skip across the whole area.

This is done via Brickmaps 2 3 (generally recommended), Sparse Voxel Octrees 4, or Sparse Voxel Directed Acyclic Graphs 5 6.

Each method has various trade-offs in terms of tracing performance, editing/update speeds and memory footprint. Please carefully read each paper and compare implementations, if possible.

In regards to games, you'll want to have various dynamic objects and repeated elements that are not directly part of the 'primary' voxel volume, so it might make sense to have something like a Bounding Volume Hierarchy 1 to raytrace these.

References

1

(1987) A Fast Voxel Traversal Algorithm for Ray Tracing - Amanatides, John & Woo, Andrew

2

(2015) Real-time Ray Tracing and Editing of Large Voxel Scenes - Wingerden, Thijs van

3

(2022) Novel Extended Brickmap for Real-Time Ray Tracing - Hjerpbakk, Aksel

4

(2010) Efficient Sparse Voxel Octrees; Analysis, Extensions, and Implementation - Laine, Samuli & Karras, Tero

5

(2017) Symmetry-aware Sparse Voxel DAGs (SSVDAGs) for compression-domain tracing of high-resolution geometric scenes - Jaspe-Villanueva, Alberto & Marton, Fabio & Gobbetti, Enrico

6

(2020) Interactively Modifying Compressed Sparse Voxel Representations - Careil, V. & Billeter, M. & Eisemann, Elmar

7

(2021) A Survey on Bounding Volume Hierarchies for Ray Tracing - Meister, Daniel & Ogaki, Shinki & Benthin, Carsten & Doyle, Michael J. & Guthe, Michael & Bitner, Jiri

Here are some more interesting and cool papers you might like to read too; some aren't directly related to voxel raytracing, we just think they're nice:

8

(2010) Voxel-Based Terrain for Real-Time Virtual Simulations - Lengyel, Eric

9

(2011) Fast Hydraulic and Thermal Erosion on the GPU - Jako, Balazs

10

(2011) GigaVoxels_ A Voxel-Based Rendering Pipeline for Efficient Exploration of Large and Detailed Scenes - Crassin, Cyril

11

(2015) Grid-free out-of-core voxelization to sparse voxel octrees on GPU - Pätzold, Martin & Kolb, Andreas

12

(2016) Fast Voxel-Based Hydraulic Erosion - Weiss, Sebastian

13

(2016) Large Scale Terrain Generation from Tectonic Uplift and Fluvial Erosion - Cordonnier, Guillaume & Braun, Jean & Cani, Marie-Paule & Benes, Berich & Galin, Eric & Peytavie, Adrien & Guerin, Eric

14

(2017) Spatiotemporal Variance-Guided Filtering (SVGF) - Schied, Christoph & Kaplanyan, Anton & Wyman, Chris & Patney, Anjul & Chaitanya, Chakravarty

15

(2018) Hierarchical Dynamic Pathfinding for Large Voxel Worlds - Alain, Benoit

16

(2020) ReSTIR: Spatiotemporal Reservoir Resampling for Real-time Ray Tracing with Dynamic Direct Lighting - Bitterli, Benedikt & Wyman, Chris & Pharr, Matt & Shirley, Peter & Lefohn, Aaron & Jarosz, Wojciech

17

(2021) ReSTIR GI: Path Resampling for Real-Time Path Tracing - Ouyang, Y. & Liu, S. & Kettunen, M. & Pharr, M. & Pantaleoni, J.