public class SoRenderToTarget extends SoSeparator
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. It is possible to disable this feature by setting the field 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 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 SoRenderToTextureProperty
node can also be used to create a texture image and is useful for simpler cases.
NOTES:
SoSFImage
field of the texture.
SoTexture2
and SoTexture3
nodes are supported. Using other types in the targets field will result in SoDebugErrors.
SoTexture
.
SoRenderToTarget
is an 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. SoRenderToTarget
can also be used separate from the main scene graph and re-rendered as-needed by applying an SoGLRenderAction
. In this case the children of the 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 SoSceneManager
will not be done automatically. For example, the OpenGL depth test is not enabled. Use an SoDepthBuffer
node to do this.
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 SoRenderToTarget
scenegraph's bounding box, like when doing post-processing effects. In that case, manually set 'boundingBoxIgnoring' to false.
RenderToTarget {
modes | AUTO |
targets | NULL |
layers | 0 |
clearTargets | true |
antialiasingQuality | 0.F |
size | (-1, -1) |
enableFragmentsQuery | false |
Action behavior:
SoGLRenderAction
Performs an offscreen rendering using either FBO, PBuffer or pixmap. Sets: SoCacheElement
See also:
Modifier and Type | Class and Description |
---|---|
static class |
SoRenderToTarget.Attachments
Attachment.
|
static class |
SoRenderToTarget.ModeType
This enum defines modifiers for the auto detection mechanism.
|
SoSeparator.Cachings, SoSeparator.FastEditings, SoSeparator.RenderUnitIds
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFFloat |
antialiasingQuality
This field defines the antialiasing quality between 0.0 and 1.0 for the rendering.
|
static int |
AUTO
Deprecated.
Use
SoRenderToTarget.ModeType.AUTO instead. |
SoSFBool |
clearTargets
If this field is set the targets are cleared before the rendering.
|
static int |
COLOR0
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR0 instead. |
static int |
COLOR1
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR1 instead. |
static int |
COLOR10
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR10 instead. |
static int |
COLOR11
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR11 instead. |
static int |
COLOR12
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR12 instead. |
static int |
COLOR13
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR13 instead. |
static int |
COLOR14
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR14 instead. |
static int |
COLOR15
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR15 instead. |
static int |
COLOR2
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR2 instead. |
static int |
COLOR3
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR3 instead. |
static int |
COLOR4
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR4 instead. |
static int |
COLOR5
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR5 instead. |
static int |
COLOR6
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR6 instead. |
static int |
COLOR7
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR7 instead. |
static int |
COLOR8
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR8 instead. |
static int |
COLOR9
Deprecated.
Use
SoRenderToTarget.Attachments.COLOR9 instead. |
static int |
DEPTH
Deprecated.
Use
SoRenderToTarget.Attachments.DEPTH instead. |
SoSFBool |
enableFragmentsQuery
This field enables or disables the query counter used to count the number of fragments rasterized during the render to texture operation.
|
static int |
INTERNAL
Deprecated.
Use
SoRenderToTarget.ModeType.INTERNAL instead. |
static int |
LAST_ENTRY
Deprecated.
Use
SoRenderToTarget.Attachments.LAST_ENTRY instead. |
SoMFInt32 |
layers
This field is used when targets are
SoTexture3 . |
SoMFEnum<SoRenderToTarget.ModeType> |
modes
This defines the mode modifier for the targets.
|
static int |
NONE
Deprecated.
Use
SoRenderToTarget.ModeType.NONE instead. |
SoSFVec2i32 |
size
This field allows a custom rendering size for the render to texture.
|
static int |
STENCIL
Deprecated.
Use
SoRenderToTarget.Attachments.STENCIL instead. |
static int |
TARGET_COPY
Deprecated.
Use
SoRenderToTarget.ModeType.TARGET_COPY instead. |
SoMFNode |
targets
This field allows to attach a texture to a specific attachment.
|
boundingBoxCaching, CLEAR_ZBUFFER, directVizCaching, DISABLE, fastEditing, KEEP_ZBUFFER, OFF, ON, pickCulling, renderCaching, renderCulling, renderUnitId
boundingBoxIgnoring
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoRenderToTarget()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getRasterizedSamplesCount()
Returns the number of samples generated by the rasterizer during the last GLRender action.
|
static boolean |
isSupported()
Calls isSupported((com.openinventor.inventor.misc.SoState)null).
|
static boolean |
isSupported(SoState state)
Indicates if this node can be used on the actual hardware.
|
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
@Deprecated public static final int COLOR0
SoRenderToTarget.Attachments.COLOR0
instead.@Deprecated public static final int COLOR1
SoRenderToTarget.Attachments.COLOR1
instead.@Deprecated public static final int COLOR2
SoRenderToTarget.Attachments.COLOR2
instead.@Deprecated public static final int COLOR3
SoRenderToTarget.Attachments.COLOR3
instead.@Deprecated public static final int COLOR4
SoRenderToTarget.Attachments.COLOR4
instead.@Deprecated public static final int COLOR5
SoRenderToTarget.Attachments.COLOR5
instead.@Deprecated public static final int COLOR6
SoRenderToTarget.Attachments.COLOR6
instead.@Deprecated public static final int COLOR7
SoRenderToTarget.Attachments.COLOR7
instead.@Deprecated public static final int COLOR8
SoRenderToTarget.Attachments.COLOR8
instead.@Deprecated public static final int COLOR9
SoRenderToTarget.Attachments.COLOR9
instead.@Deprecated public static final int COLOR10
SoRenderToTarget.Attachments.COLOR10
instead.@Deprecated public static final int COLOR11
SoRenderToTarget.Attachments.COLOR11
instead.@Deprecated public static final int COLOR12
SoRenderToTarget.Attachments.COLOR12
instead.@Deprecated public static final int COLOR13
SoRenderToTarget.Attachments.COLOR13
instead.@Deprecated public static final int COLOR14
SoRenderToTarget.Attachments.COLOR14
instead.@Deprecated public static final int COLOR15
SoRenderToTarget.Attachments.COLOR15
instead.@Deprecated public static final int DEPTH
SoRenderToTarget.Attachments.DEPTH
instead.@Deprecated public static final int STENCIL
SoRenderToTarget.Attachments.STENCIL
instead.@Deprecated public static final int LAST_ENTRY
SoRenderToTarget.Attachments.LAST_ENTRY
instead.@Deprecated public static final int AUTO
SoRenderToTarget.ModeType.AUTO
instead.@Deprecated public static final int INTERNAL
SoRenderToTarget.ModeType.INTERNAL
instead.@Deprecated public static final int TARGET_COPY
SoRenderToTarget.ModeType.TARGET_COPY
instead.@Deprecated public static final int NONE
SoRenderToTarget.ModeType.NONE
instead.public final SoMFEnum<SoRenderToTarget.ModeType> modes
Mode
. Default is AUTO.
NOTE: This field is indexed using the Attachment enum. For example (in pseudo-code):
public final SoMFNode targets
SoTexture2
and SoTexture3
, default is empty (no targets).
NOTE: This field is indexed using the Attachment enum. For example (in pseudo-code):
public final SoMFInt32 layers
SoTexture3
.
It describes the layer, along the Z dimension of SoTexture3
, where the color attachment must be written. This field is indexed by color attachments (i.e. from COLOR0 to COLOR15) and has no effect when targets are of type SoTexture2
or when target attachments are DEPTH or STENCIL, which require a SoTexture2
Target.public final SoSFBool clearTargets
public final SoSFFloat antialiasingQuality
NOTE: Hardware limitations: The result depends on the support for multisampling in FBO or the FSAA support for PBuffers.
public final SoSFVec2i32 size
public final SoSFBool enableFragmentsQuery
The method getRasterizedSamplesCount()
can be used to get the result of the query.
public static boolean isSupported()
public int getRasterizedSamplesCount()
public static boolean isSupported(SoState state)
SoGLExtension
for an example of using SoGLContext
to avoid them.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com