Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoGLRenderAction Class Reference

Renders a scene graph using Open Inventor's Render Engine. More...

#include <Inventor/actions/SoGLRenderAction.h>

+ Inheritance diagram for SoGLRenderAction:

Public Types

enum  TransparencyType {
  NO_TRANSPARENCY ,
  NO_SORT ,
  OPAQUE_FIRST ,
  SORTED_OBJECT ,
  SORTED_PIXEL
}
 Transparency rendering algorithm. More...
 
enum  FastEditSavePolicy {
  DISABLE ,
  EACH_FRAME ,
  WHEN_NEEDED
}
 Fast edit traversal types. More...
 
enum  AbortCode {
  CONTINUE ,
  ABORT ,
  PRUNE ,
  DELAY
}
 Possible return codes from a render abort callback. More...
 
enum  InvalidateCacheMode {
  OFF ,
  ONCE ,
  ALWAYS
}
 Invalidate cache mode. More...
 
enum  AutoCacheMode {
  DO_AUTO_CACHE = 1 ,
  DONT_AUTO_CACHE = 2
}
 Two bits are stored. More...
 
typedef void SoGLRenderPassCB(void *userData)
 Callback functions used between rendering passes should be of this type.
 
typedef AbortCode SoGLRenderAbortCB(void *userData)
 Callback functions for render abort should be of this type.
 
- Public Types inherited from SoAction
enum  DistribMode {
  LOCAL_ONLY ,
  CLUSTER_ONLY ,
  ALL
}
 This is used to define the way an action is distributed across a cluster. More...
 
enum  AppliedCode {
  NODE ,
  PATH ,
  PATH_LIST
}
 This enum is used to determine what the action is being applied to. More...
 
enum  PathCode {
  NO_PATH ,
  IN_PATH ,
  BELOW_PATH ,
  OFF_PATH
}
 This enum may be used during traversal of nodes to indicate where the node is with respect to the path being traversed. More...
 

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoGLRenderAction (const SbViewportRegion &viewportRegion)
 Constructor.
 
void setViewportRegion (const SbViewportRegion &newRegion)
 Changes viewport region to use for rendering.
 
const SbViewportRegiongetViewportRegion () const
 Returns viewport region to use for rendering.
 
void setLogicalViewportRegion (const SbViewportRegion &newLogicalRegion)
 Sets current logical viewport region to use for rendering.
 
const SbViewportRegiongetLogicalViewportRegion () const
 Returns current logical viewport region.
 
void setUpdateArea (const SbVec2f &origin, const SbVec2f &size)
 Sets the current update area, which is the rectangular area of the viewport region that will actually be rendered into.
 
void getUpdateArea (SbVec2f &origin, SbVec2f &size) const
 Returns the current update area.
 
void setAbortCallback (SoGLRenderAbortCB *func, void *userData)
 Sets callback to call during rendering to test for an abort condition.
 
void setTransparencyType (TransparencyType type)
 Sets global transparency algorithm to use when rendering.
 
TransparencyType getTransparencyType () const
 Returns transparency quality level to use when rendering.
 
void setFastEditSavePolicy (FastEditSavePolicy policy, SbBool fastEditDelayedObjects=FALSE)
 Sets fast editing save policy to use when rendering.
 
FastEditSavePolicy getFastEditSavePolicy () const
 Returns fast editing save policy used when rendering.
 
SoDEPRECATED void setSmoothing (SbBool smooth)
 Sets smoothing flag.
 
SoDEPRECATED SbBool isSmoothing () const
 Returns smoothing flag.
 
void setNumPasses (int num)
 Sets number of rendering passes for multipass antialiasing.
 
int getNumPasses () const
 Gets number of rendering passes for multipass rendering.
 
void setPassUpdate (SbBool flag)
 Sets a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement (default is FALSE).
 
SbBool isPassUpdate () const
 Returns a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement.
 
void setPassCallback (SoGLRenderPassCB *func, void *userData)
 Sets a callback function to invoke between passes when antialiasing.
 
void setCacheContext (uint32_t context)
 Sets the OpenGL cache context.
 
uint32_t getCacheContext () const
 Returns the OpenGL cache context id for this action.
 
void setSortedLayersNumPasses (int num)
 Sets the number of rendering passes used when transparency type is SORTED_PIXEL.
 
int getSortedLayersNumPasses () const
 Returns the number of rendering passes used when transparency type is SORTED_PIXEL.
 
void setAlphaTest (SbBool flag)
 Enable or disable the OpenGL alpha test for rendering.
 
SbBool isAlphaTest () const
 Returns whether the OpenGL alpha test is enabled for rendering.
 
void setRenderingIsRemote (SbBool flag)
 Sets whether or not "remote" rendering is done.
 
SbBool getRenderingIsRemote () const
 Returns TRUE if remote rendering is being done.
 
virtual void invalidateState ()
 Invalidate the state, forcing it to be recreated at the next apply.
 
void setDecimationValue (SoDecimationTypeElement::Type type, float percentage=1.0)
 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.
 
SoDecimationTypeElement::Type getDecimationType ()
 Gets decimation type.
 
float getDecimationPercentage ()
 Gets decimation percentage, the value should be a number between 0.0 and 1.0.
 
void setInvalidateCacheMode (InvalidateCacheMode icm)
 Enables or disables the invalidation of render caches.
 
InvalidateCacheMode getInvalidateCacheMode ()
 Returns the current cache invalidation mode.
 
uint32_t getFrameCounter () const
 Returns the current frame counter.
 
void resetFrameCounter (uint32_t count=0)
 Reset the frame counter.
 
virtual void apply (SoNode *node)
 Initiates an action on the graph defined by a node.
 
virtual void apply (SoPath *path)
 Initiates an action on the graph defined by a path.
 
virtual void apply (const SoPathList &pathList, SbBool obeysRules=FALSE)
 Initiates an action on the graph defined by a list of paths.
 
void shouldAutoCache (AutoCacheMode 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):
 
- Public Member Functions inherited from SoAction
virtual ~SoAction ()
 Destructor.
 
virtual void clearApplyResult ()
 When applied, an action may reference nodes or create objects (e.g.
 
void stopActionInBranch ()
 This function stops the action in the current Scene Graph branch.
 
SbBool getContinueActionInBranchFlag () const
 This function indicates if the action must stop in the current branch.
 
void resetContinueActionInBranchFlag ()
 This function resets the continue action flag.
 
void useAlternateRep (const SbBool enable)
 Tell the action to use alternate representations during traversal when available.
 
SbBool isUsingAlternateRep () const
 Returns TRUE if current action is using alternate representations.
 
void setSceneManager (SoSceneManager *mgr)
 Set the scene manager associated with this action (if any ).
 
SoSceneManagergetSceneManager () const
 Return the SoSceneManager associated with this action.
 
virtual void forwardTraversal (SoNode *node)
 Traverse a node that is not part of the current scenegraph.
 
virtual void forwardTraversal (SoPath *path)
 Traverse a path that is not part of the current scenegraph.
 
DistribMode getDistribMode () const
 Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only).
 
AppliedCode getWhatAppliedTo () const
 Returns code indicating what action is being applied to.
 
SoNodegetNodeAppliedTo () const
 Returns the node the action is being applied to.
 
SoPathgetPathAppliedTo () const
 Returns the path the action is being applied to.
 
const SoPathListgetPathListAppliedTo () const
 Returns the path list the action is being applied to.
 
const SoPathListgetOriginalPathListAppliedTo () const
 Returns the original path list the action is being applied to.
 
SbBool isLastPathListAppliedTo () const
 Returns TRUE if the current list is the last one from the original.
 
PathCode getPathCode (int &numIndices, const int *&indices)
 Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to.
 
PathCode getPathCodeMI (int &numIndices, const int *&indices, const int *&instanceIndices)
 Extender API: available to programmers who wish to extend the toolkit
 
void traverse (SoNode *node)
 Does traversal of a graph rooted by a node.
 
SbBool hasTerminated () const
 Returns TRUE if the traversal has reached a termination condition.
 
const SoPathgetCurPath ()
 Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed.
 
SoStategetState () const
 Gets the state from the action.
 
void setPipeId (int id)
 Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
 
int getPipeId () const
 Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
 
bool isBeingApplied ()
 Returns TRUE if this action is currently being applied.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static uint32_t generateCacheContext ()
 Generates and returns a new cache context id.
 
static bool isUsedCacheContext (uint32_t context)
 Returns TRUE if the specified cache context id is currently used by any SoGLRenderAction.
 
static SbBool isSortedLayersSupported (SoState *state=NULL)
 Indicates if SORTED_PIXEL transparency is supported by your graphics board on the current context.
 
- Static Public Member Functions inherited from SoAction
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static void nullAction (SoAction *, SoNode *)
 Null action method that can be stored in lookup table when desired.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Detailed Description

Renders a scene graph using Open Inventor's Render Engine.

This class renders a scene graph using Open Inventor's render engine. This action traverses a scene graph and queues commands that allow the render engine to render the scene asynchronously. Note that (despite the "historical" name) this class is not dependent on any graphics library and does not directly provide rendering to a window.

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:

  • With a material that has a transparency value set either by a material node or a vertex property node.
    or
  • With a texture that has an alpha value < 1.

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:

  • Transparency type SORTED_PIXEL.
    The environment variable OIV_NO_SHADER_LAYERS_BLEND allows you to disable the use of a fragment shader for this technique.
  • SoRenderList nodes, e.g. SoOctreeOrdering.
    Objects that are delayed are generally rendered in the sequence below, but other objects are rendered in various specific orders, not in scene graph order. See the specific node for details.

The general rendering order is:

  1. Scene graph traversal
    All objects not in one of the following categories, specifically including transparent objects using the NO_SORT transparency type.

  2. FastEdit KEEP_ZBUFFER objects
    Objects under an SoSeparator node with fastEditing field set to KEEP_ZBUFFER.

  3. Opaque delayed objects

  4. Transparent delayed objects
    Objects using transparency types OPAQUE_FIRST or SORTED_PIXEL. Note that by default the OpenGL depth buffer is not updated while rendering these objects.

  5. Transparent sorted objects
    Objects using transparency types SORTED_OBJECT These objects are sorted by the distance of their bounding box from the camera, then rendered in back-to-front order. Note that by default the OpenGL depth buffer is not updated while rendering these objects.

  6. Annotation delayed objects
    Objects under an SoAnnotation node.

  7. FastEdit CLEAR_ZBUFFER objects
    Objects under an SoSeparator node with fastEditing field set to CLEAR_ZBUFFER.

Elements
Sets: SoDecimationTypeElement, SoDecimationPercentageElement, SoUpdateAreaElement, SoRenderPassElement, SoViewportRegionElement, SoLogicalViewportElement

Notes & Limitations:

  • Since OpenInventor 10.0, most rendering and caching mechanisms are managed by SoSceneManager, which means that a SoGLRenderAction cannot be used outside of the render() call of SoSceneManager. Hence, manually calling apply() on an SoGLRenderAction can only be done during the traversal of the scene graph, for example inside an SoCallback. Calling apply() outside of this case leads to undefined behavior and will potentially result in incorrect rendering, performance issues, memory leaks and crashes.

SEE ALSO

SoSeparator, SoWinRenderArea, SoRenderAreaCore

Definition at line 192 of file SoGLRenderAction.h.

Member Typedef Documentation

◆ SoGLRenderAbortCB

typedef AbortCode SoGLRenderAction::SoGLRenderAbortCB(void *userData)

Callback functions for render abort should be of this type.

This typedef is defined within the class, since it needs to refer to the AbortCode enumerated type.

Definition at line 400 of file SoGLRenderAction.h.

◆ SoGLRenderPassCB

typedef void SoGLRenderPassCB(void *userData)

Callback functions used between rendering passes should be of this type.

Definition at line 82 of file SoGLRenderAction.h.

Member Enumeration Documentation

◆ AbortCode

Possible return codes from a render abort callback.

Enumerator
CONTINUE 

Continue traversal as usual.

ABORT 

Stop traversing the rest of the graph.

PRUNE 

Do not traverse this node or its children, but continue.

DELAY 

Delay rendering of this node until the second pass.

Definition at line 373 of file SoGLRenderAction.h.

◆ AutoCacheMode

Two bits are stored.

Nodes that should be cached will set the DO_AUTO_CACHE bit, nodes that should NOT be cached will set the DONT_AUTO_CACHE bit. By default, DO_AUTO_CACHE is FALSE unless remote rendering is being done. DONT_AUTO_CACHE is FALSE by default. Separators will auto cache if DO_AUTO_CACHE is TRUE and DONT_AUTO_CACHE is FALSE, otherwise they won't auto-cache.

Enumerator
DO_AUTO_CACHE 
DONT_AUTO_CACHE 

Definition at line 791 of file SoGLRenderAction.h.

◆ FastEditSavePolicy

Fast edit traversal types.

See SoSeparator for additional info on fast editing.
In the following description, we will call FE the sub-scene graph allowing the fast editing feature,
and NFE the non-fast editing sub-scene graph and consider the following scene graph:

Separator {
  Separator {
    fastEditing # ( != DISABLE to activate )
    Translation {}
    Cube{}
  }
  Separator {
    Translation {} Sphere{}
    Translation {} Sphere{}
    Translation {} Sphere{}
  }
}
Enumerator
DISABLE 

Fast editing is disabled.



EACH_FRAME 

The fast edit feature is available.

The image buffer (and possibly the depth buffer, depending on the value of the SoSeparator::fastEditing field) is saved each time the scene graph is redrawn.

We recommend using the EACH_FRAME flag when manipulating a very large main scene graph. In this case, the time used for saving the buffer(s) is insignificant compared to the time to draw the scene. EACH_FRAME is recommended as well when the fast editing sub-scene graph is frequently modified: the user interactivity is better with the fast edit sub-scene graph even though the global scene frame rate may slow down.


WHEN_NEEDED 

The fast edit feature is available.

No buffer save is made during ordinary scene rendering. When a change to the fast editing sub-scene graph occurs, the entire scene is first rendered and saved, and then the fast edit nodes are drawn. During the next rendering, only the fast edit nodes are drawn. So, using this flag implies you need one more full scene rendering before starting to move your fast edit sub-scene graph interactively. It would be better to use WHEN_NEEDED when the fast editing sub-scene graph changes very rarely. In this case you will be able to render the scene at full speed because extra time will not be spent saving the image buffer.


Definition at line 329 of file SoGLRenderAction.h.

◆ InvalidateCacheMode

Invalidate cache mode.

Enumerator
OFF 

(Default) Render caches are handled normally.

See setInvalidateCacheMode().

ONCE 

Render caches are invalidated for each SoSeparator node before its children are traversed.

The invalidate cache mode is automatically set to OFF after traversal. See setInvalidateCacheMode().

ALWAYS 

Render caches are invalidated for each SoSeparator node before its children are traversed.

See setInvalidateCacheMode().

Definition at line 403 of file SoGLRenderAction.h.

◆ TransparencyType

Transparency rendering algorithm.

See setTransparencyType() method.

Note: The transparency values deprecated since OpenInventor 9 have been removed. You can find below a correspondence table:

OIV 10 OIV 9
NO_SORT NO_SORT
NO_TRANSPARENCY
SCREEN_DOOR
ADD
BLEND
OPAQUE_FIRST OPAQUE_FIRST
DELAYED_ADD
DELAYED_BLEND
SORTED_OBJECT SORTED_OBJECT
SORTED_OBJECT_ADD
SORTED_OBJECT_BLEND
SORTED_PIXEL SORTED_PIXEL
SORTED_LAYERS_BLEND
SORTED_PIXELS_BLEND
DELAYED_SORTED_LAYERS_BLEND
DELAYED_SORTED_PIXELS_BLEND
SORTED_TRIANGLES_ADD
SORTED_TRIANGLES_BLEND
SORTED_OBJECT_TRIANGLES_ADD
SORTED_OBJECT_TRIANGLES_BLEND
Enumerator
NO_TRANSPARENCY 
NO_SORT 

The simplest transparency mode.

Shapes are rendered in the same order as they are traversed.
Alpha blending is used to combine the shape color with the color in the framebuffer.
Depth buffer test and write are activated during rendering.

Limitation: A shape will not be displayed if it is behind a semi-transparent shape that has been rendered before it.

OPAQUE_FIRST 

Same as NO_SORT, but the rendering of opaque objects is performed before the rendering of semi-transparent objects.


Notes & Limitations:

  • When using this algorithm, the depth buffer is not updated (depth buffer writes are disabled) during the rendering of semi-transparent objects. As a result, complex semi-transparent shapes may not be rendered correctly.
  • Because opaque objects are forced to be rendered first, the objects rendering order does not necessarily correspond to their actual ordering in the scene graph.
  • Because semi-transparent objects are not sorted and alpha blending is not a commutative operation, the blending of several semi-transparent objects will not be correct if their order in the scene graph does not match their back-to-front ordering relative to the camera.
SORTED_OBJECT 

Same as OPAQUE_FIRST, but sorts semi-transparent objects by distances of bounding boxes from camera.

Limitation : If the bounding box of a shape is ignored by setting its boundingBoxIgnoring field to true, the rendering won't be correct.

SORTED_PIXEL 

Same as OPAQUE_FIRST, but uses a fragment-level depth sorting technique during the rendering of semi-transparent objects.


This mode generally gives the best results for complex semi-transparent objects.

Since Open Inventor 9.4, if the hardware supports the necessary OpenGL features, this transparency mode is implemented using a single-pass, order-independent fragment sorting (K-buffer or A-buffer) algorithm. The required OpenGL hardware features are: shader_image_load_store, shader_atomic_counters and shading_language_420pack. These features are standard in core OpenGL 4.2. Use SoGLExtension, if necessary, to check if they are supported.

If the hardware does not support single-pass transparency, then a multi-pass "depth peeling" algorithm is used. The required OpenGL hardware features are: Multi-Texture, Texture Environment Combine, Depth texture, and Shadow . These features are standard starting with OpenGL 1.4. The method setSortedLayersNumPasses() allows you to set the number of rendering passes for more correct transparency. Usually, four passes gives good results.

If the graphics board does not support multi-pass transparency, SORTED_OBJECT is used.

Note: If the application uses fragment sorting transparency and specifies a custom fragment shader, the application shader must call an Open Inventor GLSL method instead of setting gl_FragColor directly. See Transparency Shader API for details.

Limitations:

  • This transparency type is not compatible with interlaced stereo.
  • Texturing on semi-transparent objects is limited to one texture.
  • Using the single-pass algorithm, it is possible to run out of GPU memory for storing fragment transparency values. This should only happen for scenes with both high depth complexity and a large number of semi-transparent objects. In this case fragments from the objects traversed last in the scene graph may not be sorted correctly, resulting in small artifacts.
  • Not compatible with FSAA. use SUPERSAMPLING, FXAA or SMAA instead.

Definition at line 231 of file SoGLRenderAction.h.

Constructor & Destructor Documentation

◆ SoGLRenderAction()

SoGLRenderAction::SoGLRenderAction ( const SbViewportRegion viewportRegion)

Constructor.

The parameter defines the viewport region into which rendering will take place.

Member Function Documentation

◆ apply() [1/3]

virtual void SoGLRenderAction::apply ( const SoPathList pathList,
SbBool  obeysRules = FALSE 
)
virtual

Initiates an action on the graph defined by a list of paths.

TRUE can be passed for the obeysRules flag if the given path list has the following 4 properties:

  1. All paths have the same head node.
  2. Paths are sorted in traversal order.
  3. If one path ends at node A, no other path continues through A.
  4. No two paths are the same.

These rules will be obeyed by path lists returned by picking and by searches for non-group nodes.

Reimplemented from SoAction.

◆ apply() [2/3]

virtual void SoGLRenderAction::apply ( SoNode node)
virtual

Initiates an action on the graph defined by a node.

Warning: Most actions call ref() on the node before traversing the scene graph, then call unref() after traversal. If the node's reference count was zero (the default), the call to apply() will cause it to be destroyed.

Reimplemented from SoAction.

Reimplemented in SoBoxHighlightRenderAction, and SoHighlightRenderAction.

◆ apply() [3/3]

virtual void SoGLRenderAction::apply ( SoPath path)
virtual

Initiates an action on the graph defined by a path.

Warning: Most actions call ref() on the path before traversing the scene graph, then call unref() after traversal. If the path's reference count was zero (the default), the call to apply() will cause it to be destroyed.

Reimplemented from SoAction.

◆ generateCacheContext()

static uint32_t SoGLRenderAction::generateCacheContext ( )
static

Generates and returns a new cache context id.

The returned cache context id can then be used to pass to the setCacheContext() method call.

◆ getCacheContext()

uint32_t SoGLRenderAction::getCacheContext ( ) const

Returns the OpenGL cache context id for this action.

◆ getClassTypeId()

static SoType SoGLRenderAction::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getDecimationPercentage()

float SoGLRenderAction::getDecimationPercentage ( )
inline

Gets decimation percentage, the value should be a number between 0.0 and 1.0.

Definition at line 735 of file SoGLRenderAction.h.

◆ getDecimationType()

SoDecimationTypeElement::Type SoGLRenderAction::getDecimationType ( )
inline

Gets decimation type.

Definition at line 729 of file SoGLRenderAction.h.

◆ getFastEditSavePolicy()

FastEditSavePolicy SoGLRenderAction::getFastEditSavePolicy ( ) const
inline

Returns fast editing save policy used when rendering.

Definition at line 537 of file SoGLRenderAction.h.

◆ getFrameCounter()

uint32_t SoGLRenderAction::getFrameCounter ( ) const
inline

Returns the current frame counter.

The frame counter starts at zero and is automatically incremented each time the action is applied. The frame counter will have the same value throughout a single apply, even if there are multiple render passes, delayed rendering, etc.

Definition at line 766 of file SoGLRenderAction.h.

◆ getInvalidateCacheMode()

InvalidateCacheMode SoGLRenderAction::getInvalidateCacheMode ( )

Returns the current cache invalidation mode.

◆ getLogicalViewportRegion()

const SbViewportRegion & SoGLRenderAction::getLogicalViewportRegion ( ) const

Returns current logical viewport region.

◆ getNumPasses()

int SoGLRenderAction::getNumPasses ( ) const
inline

Gets number of rendering passes for multipass rendering.

Definition at line 578 of file SoGLRenderAction.h.

◆ getRenderingIsRemote()

SbBool SoGLRenderAction::getRenderingIsRemote ( ) const

Returns TRUE if remote rendering is being done.

◆ getSortedLayersNumPasses()

int SoGLRenderAction::getSortedLayersNumPasses ( ) const
inline

Returns the number of rendering passes used when transparency type is SORTED_PIXEL.

Definition at line 663 of file SoGLRenderAction.h.

◆ getTransparencyType()

TransparencyType SoGLRenderAction::getTransparencyType ( ) const
inline

Returns transparency quality level to use when rendering.

See setTransparencyType().

Definition at line 520 of file SoGLRenderAction.h.

◆ getTypeId()

virtual SoType SoGLRenderAction::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Implements SoTypedObject.

Reimplemented in SoBoxHighlightRenderAction, SoColorHighlightRenderAction, SoHaloHighlightRenderAction, SoHighlightRenderAction, and SoLineHighlightRenderAction.

◆ getUpdateArea()

void SoGLRenderAction::getUpdateArea ( SbVec2f origin,
SbVec2f size 
) const

Returns the current update area.

See setUpdateArea() for details.

◆ getViewportRegion()

const SbViewportRegion & SoGLRenderAction::getViewportRegion ( ) const
inline

Returns viewport region to use for rendering.

Definition at line 442 of file SoGLRenderAction.h.

◆ invalidateState()

virtual void SoGLRenderAction::invalidateState ( )
virtual

Invalidate the state, forcing it to be recreated at the next apply.

Reimplemented from SoAction.

◆ isAlphaTest()

SbBool SoGLRenderAction::isAlphaTest ( ) const
inline

Returns whether the OpenGL alpha test is enabled for rendering.

Definition at line 694 of file SoGLRenderAction.h.

◆ isPassUpdate()

SbBool SoGLRenderAction::isPassUpdate ( ) const
inline

Returns a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement.

The default value can be set using the environment variable OIV_ANTIALIAS_PASS_UPDATE.

Definition at line 593 of file SoGLRenderAction.h.

◆ isSmoothing()

SoDEPRECATED SbBool SoGLRenderAction::isSmoothing ( ) const
inline

Returns smoothing flag.

Definition at line 556 of file SoGLRenderAction.h.

◆ isSortedLayersSupported()

static SbBool SoGLRenderAction::isSortedLayersSupported ( SoState state = NULL)
static

Indicates if SORTED_PIXEL transparency is supported by your graphics board on the current context.

◆ isUsedCacheContext()

static bool SoGLRenderAction::isUsedCacheContext ( uint32_t  context)
static

Returns TRUE if the specified cache context id is currently used by any SoGLRenderAction.

◆ resetFrameCounter()

void SoGLRenderAction::resetFrameCounter ( uint32_t  count = 0)
inline

Reset the frame counter.

Do not call this method during a traversal.

Definition at line 772 of file SoGLRenderAction.h.

◆ setAbortCallback()

void SoGLRenderAction::setAbortCallback ( SoGLRenderAbortCB func,
void *  userData 
)
inline

Sets callback to call during rendering to test for an abort condition.

It will be called for each node that is traversed. This allows applications to terminate rendering prematurely if some condition occurs. The callback function should return one of the AbortCode codes to indicate whether traversal should continue. Use of the various codes in a callback can allow applications to modify Open Inventor's default order of rendering objects in a scene graph.

Definition at line 478 of file SoGLRenderAction.h.

◆ setAlphaTest()

void SoGLRenderAction::setAlphaTest ( SbBool  flag)

Enable or disable the OpenGL alpha test for rendering.

Default is FALSE (alpha test disabled) and the default test is "not equal to zero". The alpha test operates on all pixel writes, including those resulting from the scan conversion of points, lines, polygons, and bitmaps, and from pixel draw and copy operations. It does not affect screen clear operations.

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).

◆ setCacheContext()

void SoGLRenderAction::setCacheContext ( uint32_t  context)

Sets the OpenGL cache context.

A cache context is just an integer identifying when OpenGL display lists (which are used for render caching) can be shared between render actions; for example, see the documentation on GLX contexts for information on when OpenGL display lists can be shared between GLX windows. See generateCacheContext(). Note: The value 0xFFFFFFFF (~0) is reserved to represent an undefined id.

◆ setDecimationValue()

void SoGLRenderAction::setDecimationValue ( SoDecimationTypeElement::Type  type,
float  percentage = 1.0 
)

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.

◆ setFastEditSavePolicy()

void SoGLRenderAction::setFastEditSavePolicy ( FastEditSavePolicy  policy,
SbBool  fastEditDelayedObjects = FALSE 
)

Sets fast editing save policy to use when rendering.

The default is WHEN_NEEDED. Valid values are DISABLE, EACH_FRAME, and WHEN_NEEDED. See 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.

◆ setInvalidateCacheMode()

void SoGLRenderAction::setInvalidateCacheMode ( InvalidateCacheMode  icm)

Enables or disables the invalidation of render caches.

  • When set to ALWAYS, the caches are invalidated for each 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.
  • When set to ONCE, the caches are invalidated for each SoSeparator node before its children are traversed. The invalidate cache mode is automatically changed to OFF at the end of the traversal.
  • When set to OFF (default), caches are managed by their respective render caching nodes in the usual way.

This method is useful to force all nodes to be visited during render traversal.

◆ setLogicalViewportRegion()

void SoGLRenderAction::setLogicalViewportRegion ( const SbViewportRegion newLogicalRegion)

Sets current logical viewport region to use for rendering.

Setting an empty viewport region (0,0) unsets the logical viewport.

◆ setNumPasses()

void SoGLRenderAction::setNumPasses ( int  num)

Sets number of rendering passes for multipass antialiasing.

The default is 1. Specifying more than one pass will result in antialiasing of the rendered scene, using OpenGL's accumulation buffer. (Camera nodes typically move their viewpoints a little bit for each pass to achieve the antialiasing.) Each additional pass provides better antialiasing, but requires more rendering time.

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.

◆ setPassCallback()

void SoGLRenderAction::setPassCallback ( SoGLRenderPassCB func,
void *  userData 
)
inline

Sets a callback function to invoke between passes when antialiasing.

Passing NULL (which is the default state) will cause a clear of the color and depth buffers to be performed.

Definition at line 600 of file SoGLRenderAction.h.

◆ setPassUpdate()

void SoGLRenderAction::setPassUpdate ( SbBool  flag)
inline

Sets a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement (default is FALSE).

Definition at line 584 of file SoGLRenderAction.h.

◆ setRenderingIsRemote()

void SoGLRenderAction::setRenderingIsRemote ( SbBool  flag)

Sets whether or not "remote" rendering is done.

Inventor's auto-render-caching algorithm will choose to cache more often when rendering is remote (the assumption being that performance will be better with display lists stored on the remote machine). By default, it is assumed rendering is NOT remote.

◆ setSmoothing()

SoDEPRECATED void SoGLRenderAction::setSmoothing ( SbBool  smooth)

Sets smoothing flag.

When on, smoothing uses OpenGL's line- and point-smoothing features to provide cheap antialiasing of lines and points. The default is FALSE.

The default value can be set using the environment variable OIV_GL_SMOOTHING (0 = FALSE, 1 = TRUE).

◆ setSortedLayersNumPasses()

void SoGLRenderAction::setSortedLayersNumPasses ( int  num)
inline

Sets the number of rendering passes used when transparency type is 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:

  • If hardware support for single pass transparency is not available, then the previous "depth peeling" algorithm is used (which normally requires multiple passes), or
  • If volume rendering (see 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.

Definition at line 654 of file SoGLRenderAction.h.

◆ setTransparencyType()

void SoGLRenderAction::setTransparencyType ( TransparencyType  type)

Sets global transparency algorithm to use when rendering.

Use enum TransparencyType. The default is NO_SORT, but SORTED_PIXEL is recommended for most cases. See also 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:

  • When using transparency types with DELAYED in the name, the depth buffer is not updated (depth buffer writes are disabled) while rendering transparent objects. As a result complex 3D shapes may not be rendered correctly.
  • When using a delayed transparency mode, paths to transparent objects are saved in a list. After all opaque objects have been rendered, this list is rendered. In order to avoid unnecessary rendering, the common part of each path is rendered only once. This can increase performance on very complex scene graphs. However, in some cases, it can lead to incorrect rendering. In the figure below, node B is a transparent object and node A has a side effect on node B (clipping, shader...). When the compact path optimization is on (the default), node A will not be traversed during the transparency pass, which will lead to incorrect rendering. When a case like this occurs in your scene graph, set the environment variable OIV_USE_COMPACT_PATHS to false to disable this optimization.

◆ setUpdateArea()

void SoGLRenderAction::setUpdateArea ( const SbVec2f origin,
const SbVec2f size 
)

Sets the current update area, which is the rectangular area of the viewport region that will actually be rendered into.

This can be used for partial updates in applications that can manage them. The update area is specified in normalized viewport coordinates, where (0,0) is the lower left corner of the viewport and (1,1) is the upper right corner. The area is specified or returned as an origin and a size.

◆ setViewportRegion()

void SoGLRenderAction::setViewportRegion ( const SbViewportRegion newRegion)

Changes viewport region to use for rendering.

◆ shouldAutoCache()

void SoGLRenderAction::shouldAutoCache ( AutoCacheMode  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):


The documentation for this class was generated from the following file: