The vzTMGradientShader is a built-in shader to be used with the
vzTMRenderAction. This cross-platform shader implements
a gradient shading algorithm using platform dependent algorithms. Depending
on the underlying OpenGL implementation, the application might be
required to provide the per-voxel gradient values for the 'volume' texture
being rendered as a parameter to the shader (see section PARAMETERS).
In this case, the parameter 'volume' defines the actual volume data,
while the parameter 'gradient' defines the gradient values for the data.
The RGB values of 'gradient' provide the (a, b, c) coefficients for the
gradient at the corresponding voxel in 'volume'.
The application can control the light direction using the parameter 'lightdir'
and the transfer function using the parameter 'lookup_table'.
The shader allows controlling the ambient, diffuse and specular
coefficients using optional parameters. If not specified, the diffuse
coefficient is assumed to be (1.0, 1.0, 1.0) and the ambient to be
(0.0, 0.0, 0.0).
PARAMETERS
The shader expects six parameters. Two of these parameters, namely ambient
and diffuse, are optional parameters:
Name - "specular", type - vzParameterVec3f (optional - see below)
Name - "shininess", type - vzParameterVec3f (optional - see below)
Note:
The parameters 'specular' and 'shininess' do not have any effect on systems
which do not support the ARB_fragment_program OpenGL extension.
On systems which support ARB_fragment_program, if parameter 'gradient' is
not specified, the shader would compute the gradient values internally using
'central differencing'.
On systems which do not support ARB_fragment_program or the ATI_fragment_shader
OpenGL extensions, the shading algorithm uses destination alpha to compute
the gradient lighting. Hence, the application should make sure that the appropriate
visual is selected.