public class SoGLRenderAction extends SoAction
The viewer classes, SoWin/SoXt/SoQtExaminerViewer etc, automatically create a render action for you and also expose most of the rendering options for convenience. See also the viewer component classes (SceneExaminer etc).
Traversal order
Nodes from the scene graph are traversed using depth-first traversal. However, traversal of some objects may be delayed, depending on transparency options.
A transparent object is an object:
Open Inventor automatically detects these cases.
The rendering order for transparent objects depends on the transparency "type" (transparency rendering method) assigned to each object. A transparency type may be set for the entire scene graph using the SoGLRenderAction
or SoWinRenderArea
method.
There are several special cases including:
The general rendering order is:
SoSeparator
node with fastEditing field set to KEEP_ZBUFFER.
SoAnnotation
node.
SoSeparator
node with fastEditing field set to CLEAR_ZBUFFER.
Elements
Sets: SoDecimationTypeElement
, SoDecimationPercentageElement
, SoUpdateAreaElement
, SoRenderPassElement, SoViewportRegionElement
, SoLogicalViewportElement
See also:
SoSeparator
, SoWinRenderArea
, SoRenderAreaCore
Modifier and Type | Class and Description |
---|---|
static class |
SoGLRenderAction.AbortCodes
Possible return codes from a render abort callback.
|
static class |
SoGLRenderAction.AutoCacheModes
Two bits are stored.
|
static class |
SoGLRenderAction.FastEditSavePolicies
Fast edit traversal types.
|
static class |
SoGLRenderAction.InvalidateCacheModes
Invalidate cache mode.
|
static class |
SoGLRenderAction.TransparencyTypes
Transparency rendering algorithm.
|
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoGLRenderAction(SbViewportRegion viewportRegion)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
abortNow() |
void |
enableDepthPeeling3D(boolean flag)
Use 3D texturing instead of 2D for the fixed functionality emulation in depth peeling.
|
static void |
enableElement(java.lang.Class<? extends Inventor> t,
int stkIndex) |
static int |
generateCacheContext()
Generates and returns a new cache context id.
|
int |
getCacheContext()
Returns the OpenGL cache context id for this action.
|
int |
getCurPass() |
float |
getDecimationPercentage()
Gets decimation percentage, the value should be a number between 0.0 and 1.0.
|
SoDecimationTypeElement.Types |
getDecimationType()
Gets decimation type.
|
boolean |
getDelayedObjDepthWrite()
Returns whether delayed transparent objects update the depth buffer.
|
int |
getDepthPeelingPass()
Get the current pass of depth peeling, -1 if not doing depth peeling.
|
SoGLRenderAction.FastEditSavePolicies |
getFastEditSavePolicy()
Returns fast editing save policy used when rendering.
|
int |
getFrameCounter()
Returns the current frame counter.
|
SoGLRenderAction.InvalidateCacheModes |
getInvalidateCacheMode()
Returns the current cache invalidation mode.
|
SbViewportRegion |
getLogicalViewportRegion()
Returns current logical viewport region.
|
int |
getNumPasses()
Gets number of rendering passes for multipass rendering.
|
boolean |
getRenderingIsRemote()
Returns true if remote rendering is being done.
|
int |
getSortedLayersNumPasses()
Returns the number of rendering passes used when transparency type is
SORTED_PIXEL . |
SoGLRenderAction.TransparencyTypes |
getTransparencyType()
Returns transparency quality level to use when rendering.
|
SbVec2f[] |
getUpdateArea()
Returns the current update area.
|
SbViewportRegion |
getViewportRegion()
Returns viewport region to use for rendering.
|
boolean |
handleTransparency()
Calls handleTransparency(false, false).
|
boolean |
handleTransparency(boolean isTransparent)
Calls handleTransparency(isTransparent, false).
|
boolean |
handleTransparency(boolean isTransparent,
boolean isLinesOrPoints) |
boolean |
isAlphaTest()
Returns whether the OpenGL alpha test is enabled for rendering.
|
boolean |
isDoingDepthPeeling()
Return true if depth peeling is active.
|
boolean |
isPassUpdate()
Returns a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement.
|
boolean |
isSmoothing()
Returns smoothing flag.
|
static boolean |
isSortedLayersSupported()
Calls isSortedLayersSupported((com.openinventor.inventor.misc.SoState)null).
|
static boolean |
isSortedLayersSupported(SoState state)
Indicates if
SORTED_PIXEL transparency is supported by your graphics board on the current context. |
static boolean |
isUsedCacheContext(int context)
Returns true if the specified cache context id is currently used by any
SoGLRenderAction . |
void |
postDelayedTraversal()
Method called by SoMultiPassManager after delayed pass traversals.
|
boolean |
preDelayedTraversal()
Method called by SoMultiPassManager before delayed pass traversals.
|
void |
resetFrameCounter()
Calls resetFrameCounter((int)0).
|
void |
resetFrameCounter(int count)
Reset the frame counter.
|
void |
setAlphaTest(boolean flag)
Enable or disable the OpenGL alpha test for rendering.
|
void |
setCacheContext(int context)
Sets the OpenGL cache context.
|
void |
setDecimationValue(SoDecimationTypeElement.Types type)
Calls setDecimationValue(type, (float)1.0).
|
void |
setDecimationValue(SoDecimationTypeElement.Types type,
float percentage)
Sets decimation percentage, the value should be a number between 0.0 and 1.0 Useful for reducing the number of triangles rendered in the scene.
|
void |
setDelayedObjDepthWrite(boolean flag)
Control whether delayed transparent objects update the depth buffer.
|
void |
setFastEditSavePolicy(SoGLRenderAction.FastEditSavePolicies policy)
Calls setFastEditSavePolicy(policy, false).
|
void |
setFastEditSavePolicy(SoGLRenderAction.FastEditSavePolicies policy,
boolean fastEditDelayedObjects)
Sets fast editing save policy to use when rendering.
|
void |
setInvalidateCacheMode(SoGLRenderAction.InvalidateCacheModes icm)
Enables or disables the invalidation of render caches.
|
void |
setLogicalViewportRegion(SbViewportRegion newLogicalRegion)
Sets current logical viewport region to use for rendering.
|
void |
setNumPasses(int num)
Sets number of rendering passes for multipass antialiasing.
|
void |
setPassCallback(SoGLRenderPassCB func) |
void |
setPassCallback(SoGLRenderPassCB func,
java.lang.Object userData) |
void |
setPassUpdate(boolean flag)
Sets a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement (default is false).
|
void |
setRenderingIsRemote(boolean flag)
Sets whether or not "remote" rendering is done.
|
void |
setSmoothing(boolean smooth)
Sets smoothing flag.
|
void |
setSortedLayersNumPasses(int num)
Sets the number of rendering passes used when transparency type is
SORTED_PIXEL . |
void |
setTransparencyType(SoGLRenderAction.TransparencyTypes type)
Sets global transparency algorithm to use when rendering.
|
void |
setUpdateArea(SbVec2f origin,
SbVec2f size)
Sets the current update area, which is the rectangular area of the viewport region that will actually be rendered into.
|
void |
setUpState()
initialize the action state.
|
void |
setViewportRegion(SbViewportRegion newRegion)
Changes viewport region to use for rendering.
|
void |
shouldAutoCache(SoGLRenderAction.AutoCacheModes mode)
Called by nodes to say that they should/shouldn't be auto-cached (pass true if should, false if shouldn't, don't call this method at all if the node doesn't care):
|
apply, apply, clearApplyResult, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getDistribMode, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, resetContinueActionInBranchFlag, setPipeId, setSceneManager, stopActionInBranch, traverse, useAlternateRep
dispose, getNativeResourceHandle
public SoGLRenderAction(SbViewportRegion viewportRegion)
public void setPassCallback(SoGLRenderPassCB func)
public void setPassCallback(SoGLRenderPassCB func, java.lang.Object userData)
public boolean handleTransparency(boolean isTransparent)
public boolean handleTransparency()
public void setDecimationValue(SoDecimationTypeElement.Types type)
public void setFastEditSavePolicy(SoGLRenderAction.FastEditSavePolicies policy)
public static boolean isSortedLayersSupported()
public void resetFrameCounter()
public SoGLRenderAction.TransparencyTypes getTransparencyType()
setTransparencyType()
.public SbVec2f[] getUpdateArea()
setUpdateArea()
for details.public void setTransparencyType(SoGLRenderAction.TransparencyTypes type)
getTransparencyType()
. Transparency handling can be completely disabled by setting NO_SORT.
The global transparency algorithm can also be set using a method in the viewer class (e.g. SoWinRenderArea.setTransparencyType()).
The default value for this field can be set using the environment variable OIV_TRANSPARENCY_TYPE.
See SoGLRenderAction.TransparencyType
for more discussion about transparency.
Notes:
public boolean getRenderingIsRemote()
public static boolean isUsedCacheContext(int context)
SoGLRenderAction
.public static int generateCacheContext()
setCacheContext()
method call.public void shouldAutoCache(SoGLRenderAction.AutoCacheModes mode)
public void setRenderingIsRemote(boolean flag)
public int getFrameCounter()
public SoDecimationTypeElement.Types getDecimationType()
public void resetFrameCounter(int count)
public void setInvalidateCacheMode(SoGLRenderAction.InvalidateCacheModes icm)
SoSeparator
node before its children are traversed. No new caches will be built. This value forces all nodes to be visited during each render traversal.
SoSeparator
node before its children are traversed. The invalidate cache mode is automatically changed to OFF at the end of the traversal.
This method is useful to force all nodes to be visited during render traversal.
public SoGLRenderAction.InvalidateCacheModes getInvalidateCacheMode()
public float getDecimationPercentage()
public void setDecimationValue(SoDecimationTypeElement.Types type, float percentage)
public void setLogicalViewportRegion(SbViewportRegion newLogicalRegion)
public SbViewportRegion getLogicalViewportRegion()
public void setUpdateArea(SbVec2f origin, SbVec2f size)
public void setViewportRegion(SbViewportRegion newRegion)
public SbViewportRegion getViewportRegion()
public static boolean isSortedLayersSupported(SoState state)
SORTED_PIXEL
transparency is supported by your graphics board on the current context.public void setUpState()
setUpState
in class SoAction
public void setNumPasses(int num)
The default value can be set using the environment variable OIV_NUM_RENDER_PASSES.
NOTE: Multipass antialiasing can have very poor performance for large scenes. Full-scene antialiasing (multi-sample) is strongly recommended when the hardware supports it. See SoSceneManager
and SoFullSceneAntialiasing
.
public void setDelayedObjDepthWrite(boolean flag)
public void setPassUpdate(boolean flag)
public boolean handleTransparency(boolean isTransparent, boolean isLinesOrPoints)
public int getNumPasses()
public boolean isSmoothing()
public SoGLRenderAction.FastEditSavePolicies getFastEditSavePolicy()
public void postDelayedTraversal()
postDelayedTraversal
in class SoAction
public void setFastEditSavePolicy(SoGLRenderAction.FastEditSavePolicies policy, boolean fastEditDelayedObjects)
SoSeparator
.
If fastEditDelayedObjects is set to true, delayed objects won't be redrawn when editing the scene graph. It means that the composition between delayed transparent objects and the fast edit scene graph won't be correct, but rendering will be much faster if there are a lot of transparent objects.
public boolean getDelayedObjDepthWrite()
public void setSmoothing(boolean smooth)
The default value can be set using the environment variable OIV_GL_SMOOTHING (0 = false, 1 = true).
public boolean preDelayedTraversal()
preDelayedTraversal
in class SoAction
public int getSortedLayersNumPasses()
SORTED_PIXEL
.public boolean isDoingDepthPeeling()
public void setSortedLayersNumPasses(int num)
SORTED_PIXEL
.
Default is 4.
Note: Since Open Inventor 9.4, if the hardware supports the necessary OpenGL features, these transparency modes are implemented using a single-pass, order-independent fragment sorting (A-buffer) algorithm. Therefore the value of this field is not used except in two special cases:
SoVolumeRender
) is combined with geometry rendering, then multiple layers of transparency information are required and this field specifies the number of layers.
Use more passes for more correct transparency. Usually four passes (which is the default value) gives good results. For example, the number of passes needed for rendering an opaque sphere behind two cubes is the number of planes separating the sphere from the viewer. So, when backface culling is enabled, 2 faces separate the sphere from the viewer: the front face of the first cube and the front face of the second cube. The number of passes needed in this case is 2.
The default value for this field can be set using the environment variable OIV_NUM_SORTED_LAYERS_PASSES.
public boolean isAlphaTest()
public void setAlphaTest(boolean flag)
For example, if rendering with textures containing "binary" alpha values (0 or 1), the alpha test may be faster than blended transparency and does not require the use of delayed rendering transparency types.
The default value can be set using the environment variable OIV_ALPHA_TEST (0 = false, 1 = true).
public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
public int getDepthPeelingPass()
public int getCurPass()
public boolean isPassUpdate()
public boolean abortNow()
public int getCacheContext()
public void enableDepthPeeling3D(boolean flag)
public void setCacheContext(int context)
generateCacheContext()
. Note: The value 0xFFFFFFFF (~0) is reserved to represent an undefined id.Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com