SoRenderToTarget Class |
Group node that renders its children to one or more "targets".
Namespace: OIV.Inventor.Nodes
The SoRenderToTarget type exposes the following members.
Name | Description | |
---|---|---|
SoRenderToTarget | Default constructor. |
Name | Description | |
---|---|---|
AddChild | Adds a child as last one in group. | |
AffectsState | Returns true if a node has an effect on the state during traversal. | |
Callback | (Inherited from SoSeparator.) | |
ClearCacheList | (Inherited from SoSeparator.) | |
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 SoSeparator.) | |
EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). | |
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. | |
FindChild | Finds index of given child within group. | |
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 | (Inherited from SoSeparator.) | |
GetChild | Returns pointer the child node with the given index. | |
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 SoSeparator.) | |
GetName | Returns the name of an instance. | |
GetNumChildren | Returns number of children. | |
GetPrimitiveCount | (Inherited from SoSeparator.) | |
GetRasterizedSamplesCount | Returns the number of samples generated by the rasterizer during the last GLRender action. | |
GetRenderEngineMode | Returns the supported Render engine mode. | |
GetRenderUnitID | (Inherited from SoNode.) | |
GetStringName | (Inherited from SoBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GLRender | (Inherited from SoSeparator.) | |
GLRenderBelowPath | (Overrides SoSeparatorGLRenderBelowPath(SoGLRenderAction).) | |
GLRenderInPath | (Overrides SoSeparatorGLRenderInPath(SoGLRenderAction).) | |
GLRenderOffPath | (Overrides SoSeparatorGLRenderOffPath(SoGLRenderAction).) | |
GrabEventsCleanup | (Inherited from SoNode.) | |
GrabEventsSetup | (Inherited from SoNode.) | |
HandleEvent | (Inherited from SoSeparator.) | |
HasDefaultValues | Returns true if all of the object's fields have their default values. | |
InsertChild | Adds a child so that it becomes the one with the given index. | |
IsBoundingBoxIgnoring | Used by BoundingBoxAction to known if bounding box computation should be ignored or not. | |
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) | Indicates if this node can be used on the actual hardware. | |
IsSynchronizable | Gets the ScaleViz synchronizable state of this object. | |
Pick | (Inherited from SoGroup.) | |
RayPick | (Inherited from SoSeparator.) | |
RemoveAllChildren | Removes all children from group. | |
RemoveChild(Int32) | Removes child with given index from group. | |
RemoveChild(SoNode) | Removes first instance of given child from group. | |
ReplaceChild(Int32, SoNode) | Replaces child with given index with new child. | |
ReplaceChild(SoNode, SoNode) | Replaces first instance of given child with new child. | |
Search | (Inherited from SoSeparator.) | |
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. | |
SetSynchronizable | Sets this to be a ScaleViz synchronizable object. | |
SetToDefaults | Sets all fields in this object to their default values. | |
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 SoGroup.) |
Name | Description | |
---|---|---|
antialiasingQuality | This field defines the antialiasing quality between 0.0 and 1.0 for the rendering. | |
boundingBoxCaching | (Inherited from SoSeparator.) | |
boundingBoxIgnoring | Whether to ignore this node during bounding box traversal. | |
clearColorValue | Value used to clear the color buffer before the rendering. | |
clearDepthValue | Value used to clear the depth buffer before the rendering. | |
clearStencilValue | Value used to clear the stencil buffer before the rendering. | |
clearTargets | If this field is set the targets are cleared before the rendering. | |
enableFragmentsQuery | This field enables or disables the query counter used to count the number of fragments rasterized during the render to texture operation. | |
fastEditing | Specifies the fast edit mode of the separator node. | |
IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) | |
layers | This field is used when targets are OIV.Inventor.Nodes.SoTexture3 or OIV.Inventor.Nodes.SoTextureCubeMap. | |
modes | This defines the mode modifier for the targets. | |
pickCulling | Whether to cull during picking traversal. | |
renderCaching | Obsolete. Whether to cache during rendering traversal. | |
renderCulling | Whether to cull during rendering traversal. | |
renderUnitId | Used during the ScaleViz depth compositing process, this field specifies which render unit (OIRU) will render the sub scene graph below this separator. | |
size | This field allows a custom rendering size for the render to texture. | |
targets | This field allows to attach a texture to a specific attachment. | |
UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) |
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:
Only OIV.Inventor.Nodes.SoTexture2, OIV.Inventor.Nodes.SoTexture3 and OIV.Inventor.Nodes.SoTextureCubeMap nodes are supported. Using other types in the targets field will result in SoDebugErrors.
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 |
---|
Node available since Open Inventor 8.6 FILE FORMAT/DEFAULT |
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 |
OIV.Inventor.Actions.SoGLRenderAction Performs an offscreen rendering using either FBO, PBuffer or pixmap. Sets: OIV.Inventor.Elements.SoCacheElement