Game Development Reference
In-Depth Information
Since voxels are a simplified representation of the actual scene, detailed geo-
metric information is lost. In order to amplify color bleeding in the final global
illumination output, colors with high difference in their color channels (“con-
trast”) are preferred. By writing the contrast value into the highest 8 bit of the
integer color mask, colors with the highest contrast will dominate automatically,
since we write the results with an InterlockedMax() into the voxel grid. Since,
e.g., thin geometry can have opposite normals in one single voxel, not only the
color but also the normal has to be carefully written into the voxels. Therefore
it is determined to which face of a tetrahedron the current normal is closest. By
writing the corresponding dot product into the highest 5 bit of the integer normal
mask, the closest normal to each tetrahedron face is selected automatically since
we again write the results with an InterlockedMax() . According to the retrieved
tetrahedron face, the normal is written into the corresponding normal channel of
the voxel. Later on, when the voxels are illuminated, the closest normal to the
light vector is chosen so that the best illumination can be obtained. In this way
sometimes it is possible that the normal is taken from a different geometry face
as the color. However, since voxels condense information from the actual geome-
try within its boundaries, this is completely fine and will not have any negative
impact on the global illumination result.
Figure 7.1. Visualization for the voxel grid representation of the Sponza scene.
Search Nedrilad ::

Custom Search