Skip to Content
GPU PRO 3
book

GPU PRO 3

by Wolfgang Engel
February 2012
Intermediate to advanced content levelIntermediate to advanced
408 pages
12h 24m
English
A K Peters/CRC Press
Content preview from GPU PRO 3
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

GPU Pro 2

GPU Pro 2

Wolfgang Engel
GPU Pro 4

GPU Pro 4

Wolfgang Engel
GPU Pro 5

GPU Pro 5

Wolfgang Engel
GPU Pro 7

GPU Pro 7

Wolfgang Engel

Publisher Resources

ISBN: 9781439887943