
214 III Global Illumination Effects
un if or m usampler1D bitmask;
va ry in g flo at mappedZ;
va ry in g ou t u ve c4 result;
voi d main ()
{
// Set bit in voxel grid
result = texture1D(bitmask , mappedZ );
}
Listing 3.3. Fill voxel grid (fragment shader).
bit that represents the voxel in the voxel grid. This is done with the help of a
one-dimensional texture, created on the CPU beforehand (please see the source
code or [Eisemann and D´ecoret 06] for full details). The lookup texture maps a
depth value to a bitmask representing a full voxel at that certain depth interval.
The fragment shader writes this bitmask to the render target and thus sets the
corresp ...