Class SoDataSetId

  • All Implemented Interfaces:
    SafeDisposable

    public class SoDataSetId
    extends SoNode
    Property node that sets the current dataset id. When using multiple SoDataSet nodes, the dataSet id uniquely identifies each data set used in the compositing. It also specifies the OpenGL texture unit in which the textures for each data set will be stored for use by GLSL shader programs when doing render compositing.

    If an SoDataSetId node is traversed before a data set node (SoDataSet, SoVolumeData, etc), the data set node's dataSetId field is ignored and the id from the SoDataSetId node is used.

    In some cases we want to combine multiple data textures where each data texture comes from a different data set (SoVolumeData) node. In that case we could simply use each data set node's dataSetId field to assign each data texture a unique id. However it is also possible to create multiple data textures from a single data set using the SoVolumeTransform node. In this case the same data set node will be instanced in the scene graph multiple times (although its data will only be loaded in CPU memory once), but we still need to assign each data texture a unique id. This can be done using SoDataSetId nodes to specify a different data set id for each instance of the data set node. For example:

    EXAMPLE

     SoDataSetId dataSetId1 = new SoDataSetId();
     dataSetId1.id.setValue( 1 );
     SoDataSetId dataSetId2 = new SoDataSetId();
     dataSetId2.id.setValue( 2 );
     
     SoMultiDataSeparator multiDataSep = new SoMultiDataSeparator();
         multiDataSep.addChild(volumeShader); // Shader to combine volumes
         multiDataSep.addChild(volumeTransform1);
         multiDataSep.addChild(dataSetId1);
         multiDataSep.addChild(volumeData);
     
         multiDataSep.addChild(volumeTransform2);
         multiDataSep.addChild(dataSetId2);
         multiDataSep.addChild(volumeData);   // Same data node instanced again
         multiDataSep.addChild(volumeRender);
      root.addChild( multiDataSep );

    File format/default:

    SoDataSetId {

      id 1
    } Action behavior:

    SoGLRenderAction, SoCallbackAction
    Sets the current dataset id

    See Also:
    SoDataSet
    • Field Detail

      • id

        public final SoSFInt32 id
        Data set id.
        1 by default (texture unit 0 is reserved for the color lookup table by default). The number of available texture units depends on your hardware. You can query this number using SoDataSet.getMaxNumDataSet.

        Since:
        Open Inventor 8.0

    • Constructor Detail

      • SoDataSetId

        public SoDataSetId()
        Constructor.