Graphics Reference
In-Depth Information
Figure 15.15. Volume probes through the 3D data-
set: sphere, torus, torus with pixels discarded around
even multiples of 10, and teapot, as was also shown in
Figure 15.14.
void main( )
{
vec3 stp = clamp( ( vECposition.xyz + 1. ) / 2., 0., 1. );
float scalar = texture( uTexUnit, stp ).r;
if( scalar < uMin )
discard;
if( scalar > uMax )
discard;
float t = ( scalar - SMIN ) / ( SMAX - SMIN );
vec3 rgb = Rainbow( t );
fFragColor = vec4( rgb, 1. );
}
Of course, some choices of probe geometry make more sense than others.
Two examples of volume probes are shown in Figure 15.15.
Search WWH ::




Custom Search