Game Development Reference
z e ,1,2,3
Figure 6.2. Cleanup stage: Voxels beyond the boundary depth zone are retained (or-
ange), while voxels closer to the buffer center of projection are rejected (red). Voxels
that correspond to the depth value registered in the buffer must be updated (green).
image buffer. However, the spatial data are quantized according to the volume
resolution and therefore a bias b has to be introduced in order to avoid rejecting
boundary samples. Since the depth comparison is performed in eye-space, b is
equal to the voxel's
p v radius (half diagonal) clamped by the voxel boundaries in
each direction. Therefore the rejection condition becomes
p v,z >z e + b.
The example in Figure 6.2 explains the cleanup and update state changes
of a voxel with respect to the available depth information in an image buffer.
All voxels in the figure correspond to the same image buffer sample with eye-
space value z e, 1 , 2 , 3 .Voxel
is rejected (cleared) because z 1
is greater than
z e, 1 , 2 , 3 + b .Voxel
must be updated since it lies within the boundary depth
zone [ z e, 1 , 2 , 3 −
b, z e, 1 , 2 , 3 + b ]. Finally, voxel
is retained, since it lies beyond the
registered depth value.
6.2.2 Injection Phase
In the injection phase, a rectangular grid of point primitives corresponding to each
depth image buffer is sent to a vertex shader that offsets the points according to
the stored depth. The points are subsequently transformed to world space and
finally to volume-clip space. If world-space or volume clip-space coordinates are
already available in the buffers, they are directly assigned to the corresponding
injected points. The volume clip-space depth is finally used to determine the slice
in the volume where the point sample attributes are accumulated (see Listing 6.2 ).
At the end of this stage, the previous version of the scene's voxel representation
has been updated to include a partial voxelization of the scene based on the newly