SoHeightFieldRender Class |
Heightfield rendering node.
Namespace: OIV.VolumeViz.Nodes
The SoHeightFieldRender type exposes the following members.
Name | Description | |
---|---|---|
![]() | SoHeightFieldRender | Constructor. |
Name | Description | |
---|---|---|
![]() | AffectsState | Overrides default method on SoNode. |
![]() | BeginShape(SoAction, SoShapeTriangleShapes) | Calls BeginShape(action, shapeType, (OIV.Inventor.Details.SoFaceDetail ^)nullptr). (Inherited from SoShape.) |
![]() | BeginShape(SoAction, SoShapeTriangleShapes, SoFaceDetail) | These methods can be used by subclasses to generate triangles more easily when those triangles are part of a larger structure, such as a triangle strip, triangle fan, or triangulated polygon, according to the TriangleShape enumerated type. |
![]() | Callback | Implements primitive generation for all shapes. |
![]() | CallShouldGLRender | Obsolete. Calls CallShouldGLRender(action, false). (Inherited from SoShape.) |
![]() | ComputeBBox(SoAction, SbXfBox3d, SbVec3d) | Compute object oriented bounding box (OOB) for subclass using information in the given action (which may not necessarily be an SoGetBoundingBoxAction). |
![]() | ComputeBBox(SoAction, SbBox3f, SbVec3f) | (Overrides SoVolumeShapeComputeBBox(SoAction, SbBox3f, SbVec3f).) |
![]() | Copy | Calls Copy(false). (Inherited from SoNode.) |
![]() | Copy(Boolean) | Creates and returns an exact copy of the node. |
![]() | CopyFieldValues(SoFieldContainer) | Calls CopyFieldValues(fc, false). (Inherited from SoFieldContainer.) |
![]() | CopyFieldValues(SoFieldContainer, Boolean) | Copies the contents of fc's fields into this object's fields. |
![]() | Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) |
![]() | Distribute | (Inherited from SoNode.) |
![]() | DoAction | (Inherited from SoNode.) |
![]() | EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). |
![]() | EndShape | end shape previously started with beginShape(). |
![]() | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | FieldsAreEqual | Returns true if this object's fields are exactly equal to fc's fields. |
![]() | Get | Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. |
![]() | GetAllFields | Returns a list of fields, including the eventIn's and eventOut's. |
![]() | GetAlternateRep | This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type). |
![]() | GetBoundingBox | Implements bounding box method using virtual computeBBox() method. |
![]() | GetEventIn | Returns a the eventIn with the given name. |
![]() | GetEventOut | Returns the eventOut with the given name. |
![]() | GetField | Returns a the field of this object whose name is fieldName. |
![]() | GetFieldName | Returns the name of the given field in the fieldName argument. |
![]() | GetFields | Appends references to all of this object's fields to resultList, and returns the number of fields appended. |
![]() | GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) |
![]() | GetMatrix | (Inherited from SoNode.) |
![]() | GetName | Returns the name of an instance. |
![]() | GetPrimitiveCount | Counts number of primitives produced by this shape. |
![]() | GetRenderUnitID | (Inherited from SoNode.) |
![]() | GetShapeType | Gets the current shape Full Scene Antialiasing type. |
![]() | GetStringName | (Inherited from SoBase.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GLRender | (Inherited from SoSlice.) |
![]() | GLRenderBelowPath | (Inherited from SoNode.) |
![]() | GLRenderInPath | (Inherited from SoNode.) |
![]() | GLRenderOffPath | (Inherited from SoNode.) |
![]() | GrabEventsCleanup | (Inherited from SoNode.) |
![]() | GrabEventsSetup | (Inherited from SoNode.) |
![]() | HandleEvent | (Inherited from SoNode.) |
![]() | HandleInvisibleOrBBox | Obsolete. Calls HandleInvisibleOrBBox(action, false). (Inherited from SoShape.) |
![]() | HasDefaultValues | Returns true if all of the object's fields have their default values. |
![]() | Intersect | Returns true if the shape intersects the given tile. |
![]() | IsBoundingBoxIgnoring | This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored. |
![]() | IsNotifyEnabled | Notification is the process of telling interested objects that this object has changed. |
![]() | IsOverride | Returns the state of the override flag. |
![]() ![]() | IsSupported | Calls IsSupported((OIV.Inventor.Misc.SoState )nullptr). |
![]() ![]() | IsSupported(SoState) | Returns true if graphic card can render a SoHeightFieldRender. |
![]() | IsSynchronizable | Gets the ScaleViz synchronizable state of this object. |
![]() | Pick | (Inherited from SoNode.) |
![]() | RayPick | Depth of drown horizon is save in a texture and then, the depth of the picked point is recovered With screen coordinate,. |
![]() | Search | (Inherited from SoNode.) |
![]() | Set | Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. |
![]() | SetName | (Inherited from SoBase.) |
![]() | SetOverride | Turns the override flag on or off. |
![]() | SetShapeType | set the antialiasing type for this shape. |
![]() | SetSynchronizable | Sets this to be a ScaleViz synchronizable object. |
![]() | SetToDefaults | Sets all fields in this object to their default values. |
![]() | ShapeVertex | add a primitive vertex to the shape prevously started with beginShape(). |
![]() | ShouldGLRender | Obsolete. Calls ShouldGLRender(action, false). (Inherited from SoShape.) |
![]() | ShouldGLRenderCore(SoGLRenderAction) | Obsolete. Calls ShouldGLRenderCore(action, false, false). (Inherited from SoShape.) |
![]() | ShouldGLRenderCore(SoGLRenderAction, Boolean) | Obsolete. Calls ShouldGLRenderCore(action, isPointsOrLines, false). (Inherited from SoShape.) |
![]() | ToString |
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.) |
![]() | Touch | Marks an instance as modified, simulating a change to it. |
![]() | Write | (Inherited from SoNode.) |
Name | Description | |
---|---|---|
![]() | alphaUse | Specifies how to use the alpha component of each voxel's RGBA value. |
![]() | alternateRep | This field optionally holds a subgraph containing only core Open Inventor nodes that can be used for rendering when VolumeViz is not available. |
![]() | boundaryCells | Boundary cells mode. |
![]() | boundingBoxIgnoring | Whether to ignore this node during bounding box traversal. |
![]() | bumpScale | Specifies the intensity of the bump mapping effect. |
![]() | cellOutline | If true, draw outline of each heightField cell (default is false). |
![]() | cellOutlineColor | When cellOutline is true, this value specifies the cell outline color. |
![]() | cellOutlineWidth | When cellOutline is true, this value specifies the cell outline width in pixels. |
![]() | composition | Obsolete. Specifies color composition mode. |
![]() | enableBumpMapping | Specifies if a bump mapping effect will be applied to the slice. |
![]() | interpolation | Interpolation mode. |
![]() | IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) |
![]() | largeSliceSupport | Activate/deactivate direct loading of full resolution slice data. |
![]() | normalPrecision | Obsolete. Obsoletesince Open Inventor 9300 No longer used. |
![]() | UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) |
![]() | useRGBA | Specifies whether to create RGBA textures. |
SoHeightFieldRender displays a uniform grid in the XY plane whose vertices are height (Z) values stored in 2D LDM format (any LDM data set with the Z dimension equal to 1). Adding the combination of LDM data management with advanced GPU features provides a way to handle extremely large surfaces. Just as with volume data, LDM uses tiles of data and multiple levels of resolution to enable interactive frame rates even for data sets that cannot fit in system memory.
This node is used similar to SoVolumeRender, but instead of an SoVolumeData node, you use an SoHeightFieldGeometry for the data set (height values) and one or more SoHeightFieldProperty nodes for property data sets. Generally it obeys the same rules regarding multiple data sets (see SoMultiDataSeparator). Undefined or undesired points may be excluded by setting their value to the "undefined" value in the SoHeightFieldGeometry data set. In addition, undefined or undesired cells may be excluded by specifying a binary mask using an SoHeightFieldPropertyMask node.
Data set values are converted to height values in 3D space in two ways depending on the data type:
Integer values are normalized between [0,1] ([-1,1] for signed types) based on the range of values for the specific data type. For example, for UNSIGNED BYTE values the range 0..255 is mapped to 0..1.
Floating point values are not normalized (are used "as is").
Any height values in the SoHeightFieldGeometry data set that are equal to the "undefined" value will be rendered as holes in the mesh. The undefined value can be specified during the LDM conversion using the "-u" option to the LDM converter:
convert -u 127 -b 1 inputFile.lstOr by setting the undefinedValue field of the SoHeightFieldGeometry node. The default value is NaN (Not a Number).
An SoHeightFieldPropertyMask node may be used to specify undefined cells in the mesh. An undefined cell effectively removes the four corresponding height values from the mesh. (SoVolumeMask does not apply to height field rendering.)
A lighted heightfield |
VolumeViz provides default shaders that conveniently color the surface using a single property, as shown in the images. However it is also possible to combine multiple properties using a custom shader program, in the same way that you would combine multiple volumes.
The field cellOutline enables drawing the edges of the mesh cells. BoundaryCells are cells close to undefined value. If the boundaryCells field is set to ALWAYS, these cells must be always considered at all resolution levels to avoid artifacts. In SMART mode, the default, we don't take this into account for distant views.
Normally this node uses the OpenGL tessellation shader extension to speed up rendering and automatically adjust the number of generated triangles depending on the camera position and orientation. In this mode, to change the number of generated triangles, use an SoComplexity node. A value of 1 means a full tessellation with a maximum of 4 triangles per pixel and a value of 0.5 means a maximum of 1 triangle per pixel.
If tessellation shaders are not available, use the SoComplexity node to control and limit the number of generated triangles. Use the SoGLExtension method isAvailable( "GL_ARB_tessellation_shader" ) to check if tessellation shaders are supported.
Multidata rules apply to the creation of a scene graph using a SoHeightFieldRender. SoMultiDataSeparator must be used instead of SoSeparator. A minimal scene graph displaying a heightfield is:
SoHeightFieldGeometry HFGeom = new SoHeightFieldGeometry(); HFGeom.fileName.Value = "$OIVHOME/examples/source/VolumeViz/Data/horizon.ldm"; HFGeom.dataSetId.Value = 1; SoHeightFieldProperty HFProp = new SoHeightFieldProperty(); HFProp.fileName.Value = "$OIVHOME/examples/source/VolumeViz/Data/horizon.ldm"; HFProp.dataSetId.Value = 2; SoMaterial Material = new SoMaterial(); Material.diffuseColor.SetValue(1, 1, 1); SoTransferFunction TF = new SoTransferFunction(); TF.predefColorMap.Value = SoTransferFunction.PredefColorMaps.STANDARD; SoHeightFieldRender HFRend = new SoHeightFieldRender(); SoComplexity Complexity = new SoComplexity(); Complexity.value.Value = 0.25; SoMultiDataSeparator volSep = new SoMultiDataSeparator(); volSep.AddChild(HFGeom); volSep.AddChild(HFProp); volSep.AddChild(Material); volSep.AddChild(Complexity); volSep.AddChild(TF); volSep.AddChild(HFRend); root.AddChild( volSep );
Shaders
When used with an SoVolumeShader, a new shader function is available to compute lighting:
vec4 VVizComputeFrontColor(vec3 normal, vec4 color)): Add lighting to the color col.
The following shader code code will light a heightfield:
vec4 VVizComputeVolumeRendering(float sf); float VVizCombineData(vec2 tcoord); vec3 VVizComputeCoordinates(const vec3); void VVizOutputColor(vec4 color); vec4 VVizComputeFrontColor(vec3 n, vec4 col); vec3 VVizComputeGradient(vec3 tcoord); void main() { vec3 tCoord0 = VVizComputeCoordinates(gl_TexCoord[0].xyz); vec3 grad = VVizComputeGradient(tCoord0); vec3 normal = normalize(gl_NormalMatrix*grad); float sf = VVizCombineData(tCoord0.xy); vec4 col = VVizComputeVolumeRendering(sf); col = VVizComputeFrontColor(normal, col);* VVizOutputColor(col); }
Similar to other geometry, SoPickedPoint can return an SoDetail object specific to the SoHeightFieldRender node. The specific class is SoHeightFieldDetail.
Only GPU picking is supported. This means that the SoRayPickAction used for picking must have its scene manager initialized using the method SoAction.setSceneManager(). SoHandleEventAction does this automatically, so it is not necessary for the application to take any action when using (for example) a SoEventCallback node and calling the getPickedPoint() method. However if the application creates its own SoRayPickAction then it must set the scene manager. If no scene manager is specified, a warning message is issued.
Limitations:
At least one SoHeightFieldProperty which defines a property data set associated with the grid must be in the state.
If an SoROI is in the state, SoHeightFieldRender renders only one box of the ROI (ie: correct rendering only if SoROI's flag field is set to SUB_VOLUME)
Only SoHeightFieldGeometry data sets with a depth of 1 (Z dimension = 1) can be rendered.
The SoHeightFieldProperty and SoHeightFieldPropertyMask data sets must have exactly the same dimensions as the SoHeightFieldGeometry.
Triangle orientation after GPU tessellation cannot be controlled. Undefined value rendering is indeterministic.
For low resolution, undefined values can be taken into account in the property but not in the geometry. In such cases, coloring artifacts can appear.
Lighting is limited to directional lights and base color. Other kinds of lights can be implemented manually using a custom shader.
By default, two-sided lighting is not enabled ("back" side of surface will not be lighted). Use an SoShapeHints node to enable two-sided lighting.
The enableBumpMapping field is not supported on this node
SoHeightFieldPropertyMask and cellOutline can be used only if tesselation shaders are supported. Use the SoGLExtension method isAvailable( "GL_ARB_tessellation_shader" ) to check this support.
HeightFieldRender {
enableBumpMapping | false |
bumpScale | 1.0 |
alternateRep | NULL |
useRGBA | false |
normalPrecision | HIGH |
cellOutline | false |