Click or drag to resize
SoRenderToTarget Class

Group node that renders its children to one or more "targets".

Inheritance Hierarchy

Namespace: OIV.Inventor.Nodes
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public class SoRenderToTarget : SoSeparator

The SoRenderToTarget type exposes the following members.

Constructors
  NameDescription
Public methodSoRenderToTarget

Default constructor.

Top
Methods
  NameDescription
Public methodAddChild

Adds a child as last one in group.

(Inherited from SoGroup.)
Public methodAffectsState

Returns true if a node has an effect on the state during traversal.

(Inherited from SoSeparator.)
Public methodCallback
(Inherited from SoSeparator.)
Public methodClearCacheList
(Inherited from SoSeparator.)
Public methodCopy
Calls Copy(false).
(Inherited from SoNode.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDistribute
(Inherited from SoNode.)
Public methodDoAction
(Inherited from SoSeparator.)
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodFindChild

Finds index of given child within group.

(Inherited from SoGroup.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBoundingBox
(Inherited from SoSeparator.)
Public methodGetChild

Returns pointer the child node with the given index.

(Inherited from SoGroup.)
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoSeparator.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetNumChildren

Returns number of children.

(Inherited from SoGroup.)
Public methodGetPrimitiveCount
(Inherited from SoSeparator.)
Public methodGetRasterizedSamplesCount

Returns the number of samples generated by the rasterizer during the last GLRender action.

Public methodGetRenderEngineMode

Returns the supported Render engine mode.

(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGLRender
(Inherited from SoSeparator.)
Public methodGLRenderBelowPath
Public methodGLRenderInPath
Public methodGLRenderOffPath
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoSeparator.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodInsertChild

Adds a child so that it becomes the one with the given index.

(Inherited from SoGroup.)
Public methodIsBoundingBoxIgnoring

Used by BoundingBoxAction to known if bounding box computation should be ignored or not.

(Inherited from SoGroup.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override flag.

(Inherited from SoNode.)
Public methodStatic memberIsSupported
Calls IsSupported((OIV.Inventor.Misc.SoState ^)nullptr).
Public methodStatic memberIsSupported(SoState)

Indicates if this node can be used on the actual hardware.

Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodPick
(Inherited from SoGroup.)
Public methodRayPick
(Inherited from SoSeparator.)
Public methodRemoveAllChildren

Removes all children from group.

(Inherited from SoGroup.)
Public methodRemoveChild(Int32)

Removes child with given index from group.

(Inherited from SoGroup.)
Public methodRemoveChild(SoNode)

Removes first instance of given child from group.

(Inherited from SoGroup.)
Public methodReplaceChild(Int32, SoNode)

Replaces child with given index with new child.

(Inherited from SoGroup.)
Public methodReplaceChild(SoNode, SoNode)

Replaces first instance of given child with new child.

(Inherited from SoGroup.)
Public methodSearch
(Inherited from SoSeparator.)
Public methodSet

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.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Turns the override flag on or off.

(Inherited from SoNode.)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoNode.)
Public methodWrite
(Inherited from SoGroup.)
Top
Properties
  NameDescription
Public propertyantialiasingQuality

This field defines the antialiasing quality between 0.0 and 1.0 for the rendering.

Public propertyboundingBoxCaching
(Inherited from SoSeparator.)
Public propertyboundingBoxIgnoring

Whether to ignore this node during bounding box traversal.

(Inherited from SoGroup.)
Public propertyclearColorValue

Value used to clear the color buffer before the rendering.

Public propertyclearDepthValue

Value used to clear the depth buffer before the rendering.

Public propertyclearStencilValue

Value used to clear the stencil buffer before the rendering.

Public propertyclearTargets

If this field is set the targets are cleared before the rendering.

Public propertyenableFragmentsQuery

This field enables or disables the query counter used to count the number of fragments rasterized during the render to texture operation.

Public propertyfastEditing

Specifies the fast edit mode of the separator node.

(Inherited from SoSeparator.)
Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertylayers
Public propertymodes

This defines the mode modifier for the targets.

Public propertypickCulling

Whether to cull during picking traversal.

(Inherited from SoSeparator.)
Public propertyrenderCaching Obsolete.

Whether to cache during rendering traversal.

(Inherited from SoSeparator.)
Public propertyrenderCulling

Whether to cull during rendering traversal.

(Inherited from SoSeparator.)
Public propertyrenderUnitId

Used during the ScaleViz depth compositing process, this field specifies which render unit (OIRU) will render the sub scene graph below this separator.

(Inherited from SoSeparator.)
Public propertysize

This field allows a custom rendering size for the render to texture.

Public propertytargets

This field allows to attach a texture to a specific attachment.

Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Top
Remarks

This group node renders its children to one or more render targets.

Multiple targets can be "attached" to the different outputs of the node.

This node also provides antialiasing. When FrameBufferObjects (FBO) are used (this is the default mode if they are available) multisampling can be configured in order to perform antialiasing on the FBO. This MSAA feature is not related to the viewer's FSAA. The quality factor is set between 0.f(default value) and 1.f. The underlying system will setup the FBO with the correct number of samples according to the quality value and according to the attachments configuration.

By default the node clears the targets when the rendering is started. The values used to clear the buffers can be specified by the fields OIV.Inventor.Nodes.SoRenderToTarget.clearColorValue, OIV.Inventor.Nodes.SoRenderToTarget.clearDepthValue and OIV.Inventor.Nodes.SoRenderToTarget.clearStencilValue. It is also possible to disable this feature by setting the field OIV.Inventor.Nodes.SoRenderToTarget.clearTargets to false.

During rendering, the viewport from the Open Inventor state is used, which means that the current size of the render area is used. It is possible to change this default behavior by setting the OIV.Inventor.Nodes.SoRenderToTarget.size field. Setting it to (-1, -1) will switch back to the default mode, other values will be used as the custom rendering size in pixels. The targets are automatically resized to the correct size.

The OIV.Inventor.Nodes.SoRenderToTextureProperty node can also be used to create a texture image and is useful for simpler cases.

NOTES:

  • Performance:

    • Using the TARGET_COPY mode at each frame really reduces performance because a transfer from GPU memory to CPU memory is performed to transfer the data to the OIV.Inventor.Fields.SoSFImage field of the texture.

    • Antialiasing (MSAA) can really reduce performance and increase memory consumption. It can even be impossible to use antialiasing with large FLOAT color attachments.

  • Target limitations:

  • By default the textures are resized using the following rules:

    • RBGA uint8 for the color attachements. (Internal mode is RGBA8)

    • Luminance float32 for the depth attachment. (Internal mode is DEPTH_COMPONENT24).

    • Luminance uint8 for the stencil attachment. It is possible to override the default internal mode for the textures by using the internalFormat field of OIV.Inventor.Nodes.SoTexture.

  • Rendering

    • OIV.Inventor.Nodes.SoRenderToTarget is an OIV.Inventor.Nodes.SoSeparator and can be added directly to the scene graph. In this case its children are rendered as part of the main scene graph and inherit properties (camera, light, material, etc) from the main scene graph.

    • OIV.Inventor.Nodes.SoRenderToTarget can also be used separate from the main scene graph and re-rendered as-needed by applying an OIV.Inventor.Actions.SoGLRenderAction. In this case the children of the OIV.Inventor.Nodes.SoRenderToTarget will normally include a camera, light, etc node. But also note that, in this case, the OpenGL calls normally made by the viewer and/or OIV.Inventor.SoSceneManager will not be done automatically. For example, the OpenGL depth test is not enabled. Use an OIV.Inventor.Nodes.SoDepthBuffer node to do this.

  • Bounding box

    • WARNING: The 'boundingBoxIgnoring' default value is true. Usually the OIV.Inventor.Nodes.SoRenderToTarget scenegraph is not really part of the main scene and should not have any effect on the bounding box computed for the main scene. For this reason, SORTED_OBJECT_BLEND transparency is not supported for shapes that are children of this node. But in some cases, it can be useful to include the OIV.Inventor.Nodes.SoRenderToTarget scenegraph's bounding box, like when doing post-processing effects. In that case, manually set 'boundingBoxIgnoring' to false.

  • Hardware compatibility:

    • All the exposed features are supported by the FBO rendering subsystem. PBuffer and pixmap might not support some of them. For example it is not possible to have multiple color attachments in PBuffer mode. Those alternative modes are supported only for compatibility with legacy hardware.

Note Note

Node available since Open Inventor 8.6

FILE FORMAT/DEFAULT

RenderToTarget {
modes AUTO
targets NULL
layers 0
clearTargets true
clearColorValue (0.F, 0.F, 0.F, 0.F)
clearDepthValue 1.F
clearStencilValue 0
antialiasingQuality 0.F
size (-1, -1)
enableFragmentsQuery false
}

ACTION BEHAVIOR

OIV.Inventor.Actions.SoGLRenderAction Performs an offscreen rendering using either FBO, PBuffer or pixmap. Sets: OIV.Inventor.Elements.SoCacheElement

See Also