Static Public Member Functions

Detailed Description

This is the correct method for combining multiple data sets. Combining multiple data sets without inserting them under an SoMultiDataSeparator node may produce incorrect results and should be avoided.

All data sets below this node belong to the same group for subsequent multidata combining operations. Each data set is represented by an SoDataSet node (typically an SoVolumeData node). Combining is enabled by an SoDataCompositor node for CPU combining or an SoVolumeShader node for GPU combining. A common use of GPU combining is to implement co-blending of multiple volumes, in other words using a fragment shader to combine the color and/or intensity values of the voxels.

The SoVolumeData nodes to be composited must be all scalar data sets or all RGBA data sets. To composite scalar and RGBA data sets under the same SoMultiDataSeparator, set the usePalettedTexture field to false in the scalar dataset's SoVolumeData node to force the scalar data to be converted into RGBA data.

An SoVolumeData node used in a data compositing scheme must not be inserted multiple times in the scene graph. Use another volume data node pointing to the same file.

All transfer functions must have the same 'colorMapType' and must have the same number of entries in the colormap.

GPU combining must be implemented in a shader program written in the standard GLSL language. The shader program will be specified using an SoVolumeShader node. The shader source code is loaded using (for example) an SoFragmentShader object. Uniform parameters for the shader may be specified using the subclasses of SoShaderParameter. See SoVolumeShader for more information about the shader function library provided by VolumeViz.

For each data set there will typically be an SoDataRange node and an SoTransferFunction node to define the mapping from data values to color values. For each SoVolumeData a separate 3D texture will be generated and sent to the GPU. 3D textures can be generated with different precision (8-bit or 12-bit) according to the SoDataSet::texturePrecision field. The texture unit used for each data set is determined by the SoDataSet::dataSetId field. All colormaps are aggregated into a single 2D texture.

A custom fragment shader can retrieve the voxel's data value from each 3D texture using the GLSL VolumeViz function: