There are several different cases where an application has to deal with multiple volumes. The first case is where the scene contains multiple independent volumes. By independent we mean that each volume is rendered with no dependency on the data values in the other volumes. The volumes may have completely different dimensions and extent in 3D. We explain this case in Section 1.9.1, “Independent volumes”.
Another case is where the application needs to transform a volume. When we say "transforming a volume", we mean something different than transforming geometry. Although classical transform nodes can be applied to the geometric extent of a volume, transforming a volume means to modify the values in the volume, effectively producing a new volume (or volumes). Transforming a volume can be useful for tasks ranging from simply scaling the values in the volume, to applying a noise reduction filter to generating derived data sets like seismic "attributes". VolumeViz provides three ways to transform a volume:
Class SoLDMDataTransform( C++ | Java | .NET ) defines a volume transform function that is applied to each tile of data, on the CPU, after it is loaded (returned from the volume reader) but before it is stored in system memory. This transform is only applied once to each tile, so it is appropriate for transforms that do not change during program execution. This class is explained in the section called “Static transform (SoLDMDataTransform( C++ | Java | .NET ))” in this chapter.
Class SoVolumeTransform( C++ | Java | .NET ) defines a volume transform function that is applied to each tile of data, on the CPU, immediately before the data in system memory is sent to the GPU. This transform is re-applied each time a tile is sent to the GPU so it can be used for transforms that change over time. This class is explained in the section called “Dynamic transform (SoVolumeTransform( C++ | Java | .NET ))” in this chapter.
Applications can also transform volumes on the GPU as part of the rendering pipeline. This is done by writing a custom shader function in the GLSL language and replacing the VVizGetData function in the VolumeViz shader framework. This is explained in Section 1.8, “Shaders”.
The third case is where there are multiple data volumes that are combined to render a single volume on the screen. Combining volumes could mean combining the data values by arithmetic, for example computing the difference volume by subtraction. Combining volumes could mean setting data values to a completely transparent value according to the values in a second "mask" volume. Or combining volumes could mean “blending” the volumes by combining color values. VolumeViz provides two ways to combine volumes.
Class SoDataCompositor( C++ | Java | .NET ) defines a volume combining function that is applied to each set of tiles (one from each input volume), on the CPU, after they are loaded (returned from the volume reader) but before the resulting tile is stored in system memory. The combining operation is only applied once to each set of tiles and the result is a single tile. So multiple input volumes become a single volume in memory. This class is explained in Section 1.9.3, “Combining volumes”.
Applications can also combine volumes on the GPU as part of the rendering pipeline. This is done by writing a custom shader function in the GLSL language and replacing the VVizCombineData or VVizComputeFragmentColor function in the VolumeViz shader framework. This is explained in Section 1.8, “Shaders”.