This method is used to support rectilinear coordinates or custom projection. It computes voxel coordinates and must be used instead of gl_TexCoord[0].xyz. If not used, texture coordinates may not be clamped, scaled, etc... as necessary in order to have correct rendering.

The parameter usually is gl_TexCoord[0].xyz (in slicing mode only). The returned coordinate is in general directly passed to VVizCombineData method.

sf and sb are usually the volume data which have the texture coordinate gl_TexCoord[0] and gl_TexCoord[1] computed by VVizComputeFrontSliceTexCoord and VVizComputeBackSliceTexCoord. If there is no isosurface between sf and sb, a transparent pixel will be returned. Lighting is computed with the first directional light found in the scene graph.
Because it needs a special texture, this function can only be used with SoVolumeIsosurface.

Normal is returned in eye space. If bump mapping is currently enabled, the normal corresponding to bump effect will be returned.

vec3 VVizComputeNormal

(

vec3

view,

vec3

grad

)

Returns the current normal.

vec4 VVizComputePreIntegrated

(

VVIZ_DATATYPE

sf,

VVIZ_DATATYPE

sb

)

Convert the volume data values (sf, sb) to a color by lookup in the pre-integrated table.

The pre-integrated table is a precomputed table which gives an approximation of the volume rendering integral between two slices.
Because it needs a special texture, this function can only be used with SoVolumeRenderingQuality.

vec3 VVizComputePreintegratedGradient

(

vec3

tcoord0,

vec3

tcoord1

)

Returns the gradient at the center of the two slices.

vec4 VVizComputePreintegratedLighting

(

in vec4

col,

in vec3

normal,

in float

gradLength

)

Add lighting to the color col in the case of pre-integrated rendering.

col is usually the result of VVizComputePreintegrated. The difference with the VVizComputeVolumeRenderingLighting function is that the normal used for lighting is at the middle of the space between the front and the back slice. Lighting is computed with the first directional light found in the scene graph.
Because it needs a special texture, this function can only be used with SoVolumeRenderingQuality.

vec3 VVizComputeViewVec

(

)

Returns the current viewing vector.

vec4 VVizComputeVolumeRendering

(

VVIZ_DATATYPE

sf

)

Returns the conversion of the volume data value sf to color by lookup in the colormap.

NOTE: On the GPU, voxel values are always returned as a normalized value in the range 0..1. If the actual voxel value is needed, the shader function must compute that value using the current data range (see SoDataRange). The application must explicitly pass the current data range to the shader function as a uniform parameter.

Parameters:

dataset

The dataset to read

dataCoord

Uniform data coordinates in volume space.

Returns:

voxel data value.

float VVizGetLuminance

(

VVIZ_DATATYPE

data

)

Compute the luminance of a voxel value.

Parameters:

data

value to convert

Returns:

Luminance of data.

int VVizGetMask

(

in vec3

tcoord

)

Returns the mask value at the given texture coordinate.

If there is no SoVolumeMask, the returned value is the id of the transfer function on the state.

Method to access dataset, that can be used by VVizGetData custom implementation. It may apply different interpolation (linear, cubix, trilinear, multi-sample12) depending on SoVolumeRenderingQuality and SoVolumeRender nodes setup.

NOTE: On the GPU, voxel values are always returned as a normalized value in the range 0..1. If the actual voxel value is needed, the shader function must compute that value using the current data range (see SoDataRange). The application must explicitly pass the current data range to the shader function as a uniform parameter.

Parameters:

dataset

The dataset to read

dataCoord

uniform data coordinates in volume space.

Returns:

voxel data value

void VVizOutputColor

(

vec4

color

)

This function sends the final fragment color to OpenGL.

It should be used instead of directly setting gl_FragColor, in order to allow VolumeViz to do final manipulation of the color.

Should be used at the end of FRAGMENT_MAIN shader only.

Parameters:

color

the color to render.

vec4 VVizOverOperator

(

vec4

underCol,

vec4

overCol

)

Blend 2 colors using the over operator, result color is not alpha premultiplied.