The vzTMTagShader is a built-in shader to be used with the
vzTMRenderAction. The shader implements a two pass
algorithm to perform volumetric tagging. This is accomplished
using two perfectly overlapping volumes. The first volume defines the
actual volume data, while the other volume defines the 3-dimensional
stencil buffer for the data. Each value in the tag volume contains
the mask for the corresponding texel in the volume data. If the
alpha value of the tag texel is greater than 0.5, then the corresponding
texel in the volume data is rendered otherwise the texel is masked out.
The tagging algorithm uses stencil and alpha tests to perform
the task of tagging. Ideally, the tag volume should require only
one bit to represent each texel. But, on most graphics hardware,
each texel will use atleast one byte to represent a texel. On
InfiniteReality graphics, the application can specify the
internal texture format to be VZ_QUAD_INTENSITY4 and ask the
vzTMRenderAction to optimize the texture. The render action would
then interleave the texture so that each texel requires only 4-bits
to represent it, considerably improving texture memory consumption
and texture download rate.
Note: The tagging algorithm uses the stencil buffer to mask out
the volume data. Hence, the application should make sure that the
appropriate visual is selected.