public class SoMultiDataSeparator extends SoSeparator
SoMultiDataSeparator
node allows you to combine multiple data sets.
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.
Some rules must be followed when doing render or data compositing:
SoVolumeData
node must have a unique SoDataSet.dataSetId
. SoVolumeData
nodes to be composited must have the same volume dimensions (number of voxels in X, Y, and Z) and tile size. SoVolumeData
nodes to be composited, as well as the compositing node (e.g. SoVolumeShader
for slices or SoVolumeRenderingQuality
for volumes) and the rendering node (e.g. SoVolumeRender
), must be under an SoMultiDataSeparator
node.
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.
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.
SoVolumeData
node has its own resource settings (see field SoDataSet.ldmResourceParameters
). The resources required for the composition are the sum of the resources for all of the SoVolumeData
nodes involved. 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:
A custom fragment shader can lookup the color/intensity for each data value from the appropriate colormap, using the GLSL VolumeViz function:VVIZ_DATATYPE value = VVizGetData( dataSetId, texCoord );
A custom fragment shader can then compute (using custom blending functions) the actual color for the voxel and output that color using the GLSL VolumeViz function:vec4 color = VVizTransferFunction( value, colorMapId );
VVizOutputColor( color ):
The following code shows how to do multidata rendering using an SoVolumeShader
node to combine values for an SoVolumeRender
node. Given two SoVolumeData
nodes ds1 and ds2:
SoVolumeShader volumeShader = new SoVolumeShader(); SoVolumeData volumeData1 = new SoVolumeData(); volumeData1.dataSetId.setValue( 0 ); SoDataRange dataRange1 = new SoDataRange(); dataRange1.dataRangeId.setValue( 0 ); SoTransferFunction colorMap1 = new SoTransferFunction(); SoVolumeData volumeData2 = new SoVolumeData(); volumeData2.dataSetId.setValue( 1 ); SoDataRange dataRange2 = new SoDataRange(); dataRange2.dataRangeId.setValue( 1 ); SoTransferFunction colorMap2 = new SoTransferFunction(); SoVolumeRender volumeRender = new SoVolumeRender(); SoMultiDataSeparator multiDataSep = new SoMultiDataSeparator(); multiDataSep.addChild( volumeShader ); // Shader to combine volumes multiDataSep.addChild( volumeData1 ); multiDataSep.addChild( dataRange1 ); multiDataSep.addChild( colorMap1 ); multiDataSep.addChild( volumeData2 ); multiDataSep.addChild( dataRange2 ); multiDataSep.addChild( colorMap2 ); multiDataSep.addChild( volumeRender ); root.addChild(multiDataSep);
See also:
SoSeparator.Cachings, SoSeparator.FastEditings, SoSeparator.RenderUnitIds
Inventor.ConstructorCommand
AUTO, boundingBoxCaching, CLEAR_ZBUFFER, directVizCaching, DISABLE, fastEditing, KEEP_ZBUFFER, OFF, ON, pickCulling, renderCaching, renderCulling, renderUnitId
boundingBoxIgnoring
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoMultiDataSeparator()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SoLDMMediator.LDMManagerAccess |
getLdmManagerAccess()
Returns a reference to an LDMManagerAccess.
|
getNumRenderCaches, setNumRenderCaches
addChild, findChild, getChild, getNumChildren, insertChild, removeAllChildren, removeChild, removeChild, replaceChild, replaceChild
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public SoLDMMediator.LDMManagerAccess getLdmManagerAccess()
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com