Graphics Reference
In-Depth Information
continue;
if( any( greaterThan( STP, vec3(1.,1.,1.) ) ) )
continue;
float scalar = texture( uTexUnit, STP ).r;
float alpha = uAmax;
if( scalar < uMin )
alpha = 0.;
if( scalar > uMax )
alpha = 0.;
float t = ( scalar - SMIN ) / ( SMAX - SMIN );
vec3 rgb = Rainbow( t );// transfer functions like this
// will be covered in the next
// section
cstar += astar * alpha * rgb;
astar *= ( 1. - alpha );
// break out if the rest of the tracing won't matter:
if( astar == 0. )
break;
}
fFragColor = vec4( cstar, 1. );
}
Figure 15.17. The data volume shown with all colors present (left) and with the lower val-
ues culled and a reduced alpha (right).
Search WWH ::




Custom Search