Voxelization Using the GPU
Cyril Crassin and Simon Green
Discrete voxel representations are generating growing interest in a wide range of
applications in computational sciences and particularly in computer graphics. Ap-
plications range from ﬂuid simulation [Crane et al. 05], collision detection [Allard
et al. 10], and radiative transfer simulation to detail rendering [Crassin et al. 09,
Crassin et al. 10, Laine and Karras 10] and real-time global illumination [Kaplanyan
and Dachsbacher 10,Thiedemann et al. 11,Crassin et al. 11]. When used in real-time
contexts, it becomes critical to achieve fast 3D scan conversion (also called voxeliza-
tion) of traditional triangle-based surface representations [Eisemann and D´ecoret 08,
Schwarz and Seidel 10, Pantaleoni 11].
In this chapter, we will ﬁrst describe an efﬁcient OpenGL implementation of a
simple surface voxelization algorithm that produces a regular 3D texture (see Fig-
ure 22.1). This technique uses the GPU hardware rasterizer and the new image
load/store interface exposed by OpenGL 4.2. This section will allow us to familiarize
the reader with the general algorithm and the new OpenGL features we l everage.
In the second part, we will describe an extension of this approach, which enables
building and updating a sparse voxel representation in the form of an octree structure.
In order to scale to very large scenes, our approach avoids relying on an intermediate-
full regular grid to build the structure and constructs the octree directly. This second
approach exploits the draw indirect features standardized in OpenGL 4.0 in order to
allow synchronization-free launching of shader threads during the octree construc-
tion,aswellasthenewatomic counter functions exposed in OpenGL 4.2.