SoGLRenderAction(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

🌸 SoGLRenderAction(3) 🌸 β€” Library Functions Manual

okay bestie, sit down, hydrate, because today we're talking about SoGLRenderAction(3) and honestly? she's the main character of OpenGL rendering in Coin. πŸ’… no cap. let's get into it.


✨ NAME ✨

SoGLRenderAction β€” the class that renders the scene graph with OpenGL calls. that's it, that's the whole job, and she does it flawlessly. πŸ”₯


✨ SYNOPSIS ✨

#include <Inventor/actions/SoGLRenderAction.h>

Inherits SoAction.

Inherited by SoBoxHighlightRenderAction, and SoLineHighlightRenderAction. (it's giving family tree, it's giving legacy 🫢)

πŸŽ€ Public Types πŸŽ€

enum TransparencyType { SCREEN_DOOR, ADD, DELAYED_ADD,
    SORTED_OBJECT_ADD, BLEND, DELAYED_BLEND, SORTED_OBJECT_BLEND,
    SORTED_OBJECT_SORTED_TRIANGLE_ADD,
    SORTED_OBJECT_SORTED_TRIANGLE_BLEND, NONE, SORTED_LAYERS_BLEND }
enum AbortCode { CONTINUE, ABORT, PRUNE, DELAY }
enum SortedObjectOrderStrategy { BBOX_CENTER, BBOX_CLOSEST_CORNER,
    BBOX_FARTHEST_CORNER, CUSTOM_CALLBACK }
typedef AbortCode SoGLRenderAbortCB(void *userdata)

πŸŽ€ Public Types inherited from SoAction πŸŽ€

enum AppliedCode { NODE = 0, PATH = 1, PATH_LIST = 2 }
enum PathCode { NO_PATH = 0, IN_PATH = 1, BELOW_PATH = 2, OFF_PATH = 3 }

πŸ’– Public Member Functions πŸ’–

virtual SoType getTypeId (void) const
SoGLRenderAction (const SbViewportRegion &viewportregion)
virtual ~SoGLRenderAction (void)
void setViewportRegion (const SbViewportRegion &newregion)
const SbViewportRegion & getViewportRegion (void) const
void setUpdateArea (const SbVec2f &origin, const SbVec2f &size)
void getUpdateArea (SbVec2f &origin, SbVec2f &size) const
void setAbortCallback (SoGLRenderAbortCB *const func, void *const
    userdata)
void setTransparencyType (const TransparencyType type)
TransparencyType getTransparencyType (void) const
void setSmoothing (const SbBool smooth)
SbBool isSmoothing (void) const
void setNumPasses (const int num)
int getNumPasses (void) const
void setPassUpdate (const SbBool flag)
SbBool isPassUpdate (void) const
void setPassCallback (SoGLRenderPassCB *const func, void *const
    userdata)
void setCacheContext (const uint32_t context)
uint32_t getCacheContext (void) const
void addDelayedPath (SoPath *path)
SbBool isRenderingDelayedPaths (void) const
SbBool handleTransparency (SbBool istransparent=0)
int getCurPass (void) const
SbBool abortNow (void)
void setRenderingIsRemote (SbBool isremote)
SbBool getRenderingIsRemote (void) const
virtual void invalidateState (void)
void addPreRenderCallback (SoGLPreRenderCB *func, void *userdata)
void removePreRenderCallback (SoGLPreRenderCB *func, void *userdata)
void setSortedLayersNumPasses (int num)
int getSortedLayersNumPasses (void) const
void setSortedObjectOrderStrategy (const SortedObjectOrderStrategy
    strategy, SoGLSortedObjectOrderCB *cb=NULL, void *closure=NULL)

πŸ’– Public Member Functions inherited from SoAction πŸ’–

virtual ~SoAction ()
virtual SbBool isOfType (SoType type) const
virtual void apply (SoNode *root)
virtual void apply (SoPath *path)
virtual void apply (const SoPathList &pathlist, SbBool obeysrules=0)
void apply (SoAction *beingApplied)
AppliedCode getWhatAppliedTo (void) const
SoNode * getNodeAppliedTo (void) const
SoPath * getPathAppliedTo (void) const
const SoPathList * getPathListAppliedTo (void) const
const SoPathList * getOriginalPathListAppliedTo (void) const
SbBool isLastPathListAppliedTo (void) const
PathCode getPathCode (int &numindices, const int *&indices)
void traverse (SoNode *const node)
SbBool hasTerminated (void) const
const SoPath * getCurPath (void)
SoState * getState (void) const
PathCode getCurPathCode (void) const
virtual SoNode * getCurPathTail (void)
void usePathCode (int &numindices, const int *&indices)
void pushCurPath (const int childindex, SoNode *node=NULL)
void popCurPath (const PathCode prevpathcode)
void pushCurPath (void)
void popPushCurPath (const int childindex, SoNode *node=NULL)
void popCurPath (void)
void switchToPathTraversal (SoPath *path)
void switchToNodeTraversal (SoNode *node)

⭐ Static Public Member Functions ⭐

static SoType getClassTypeId (void)
static void addMethod (const SoType type, SoActionMethod method)
static void enableElement (const SoType type, const int stackindex)
static void initClass (void)

⭐ Static Public Member Functions inherited from SoAction ⭐

static void initClass (void)
static void initClasses (void)
static SoType getClassTypeId (void)
static void nullAction (SoAction *action, SoNode *node)

πŸ¦‹ Protected Member Functions πŸ¦‹

virtual const SoEnabledElementsList & getEnabledElements (void) const
virtual void beginTraversal (SoNode *node)
virtual void endTraversal (SoNode *node)

πŸ¦‹ Protected Member Functions inherited from SoAction πŸ¦‹

SoAction (void)
void setTerminated (const SbBool flag)
virtual SbBool shouldCompactPathList (void) const

🌈 Static Protected Member Functions 🌈

static SoEnabledElementsList * getClassEnabledElements (void)
static SoActionMethodList * getClassActionMethods (void)

🌈 Static Protected Member Functions inherited from SoAction 🌈

static SoEnabledElementsList * getClassEnabledElements (void)
static SoActionMethodList * getClassActionMethods (void)

πŸ‘‘ Friends πŸ‘‘

class SoGLRenderActionP

πŸ‘‘ Additional Inherited Members πŸ‘‘

Protected Attributes inherited from SoAction:

SoState * state
SoActionMethodList * traversalMethods

πŸ’œ Detailed Description πŸ’œ

The SoGLRenderAction class renders the scene graph with OpenGL calls.

Applying this method at a root node for a scene graph, path or pathlist will render all geometry contained within that instance to the current OpenGL context. yes bestie, all of it. every last polygon. she ate. πŸ’…


🧚 Member Typedef Documentation 🧚

typedef AbortCode SoGLRenderAction::SoGLRenderAbortCB(void *userdata)

Abort callbacks should be of this type.

See also: setAbortCallback()


πŸ“ Member Enumeration Documentation πŸ“

enum SoGLRenderAction::TransparencyType

Various settings for how to do rendering of transparent objects in the scene. Some of the settings will provide faster rendering, while others gives you better quality rendering.

lowkey important: doing correct rendering of multiple transparent objects often fails, because to be 100% correct, all polygons needs to be rendered in sorted order, and polygons can't intersect each other. In a dynamic scene graph it is often impossible to guarantee that no polygons intersect, and finding an algorithm that does correct sorting of polygons for all possible cases is very hard and time-consuming. 😭 so like, manage your expectations bestie.

The highest quality transparency mode in the original SGI / TGS Open Inventor is SoGLRenderAction::SORTED_OBJECT_BLEND, where all transparent objects are rendered in sorted order in a rendering pass after all opaque objects. However, this mode does not sort the polygons, and if you have an object where some polygon A is behind some other polygon B, the transparency will only be correct if A happens to be rendered before B. For other camera angles, where B is behind A, the transparency will not be correct. 🫠

In Coin we have a new transparency mode that solves some of these problems: SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND. In addition to sorting the objects, all polygons inside each object is also sorted back-to-front when rendering. But, if you have intersecting objects and/or intersecting polygons, even this transparency mode will fail. Also, because of the polygon sorting, this transparency mode is quite slow. It is possible to speed things up using the SoTransparencyType node, though, which enables you to set different transparency modes for different parts of the scene graph. If you have only have a few objects where you need to sort the polygons, you can use SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND for those, and for instance SoGLRenderAction::SORTED_OBJECT_BLEND for all other transparent objects.

The highest quality transparency mode in Coin is SoGLRenderAction::SORTED_LAYERS_BLEND. It is also the only mode that overrides all other modes in the scenegraph. πŸ‘‘

See also: SoTransparencyType

Enumerator:

  • SCREEN_DOOR β€” Transparent triangles are rendered with a dither pattern. This is a fast (on most GFX cards) but not-so-high-quality transparency mode.

One particular feature of this mode is that you are guaranteed that it always renders the transparent parts of the scene correct with regard to internal depth ordering of objects / polygons, something which is not the case for any other transparency mode.

Polygons rendered with only transparent textures are not shown as being transparent when using this mode. The reason being that the SCREEN_DOOR mode is working on polygons, not pixels. To render polygons with dither pattern, a material node has to be inserted into the scenegraph with it's transparency field set.

  • ADD β€” Transparent objects are rendered using additive alpha blending. Additive blending is probably mostly used to create special transparency effects. The new pixel color is calculated as the current pixel color plus the source pixel color multiplied with the source pixel alpha value.
  • DELAYED_ADD β€” SoGLRenderAction::DELAYED_ADD Transparent objects are rendered using additive alpha blending, in a second rendering pass with depth buffer updates disabled.
  • SORTED_OBJECT_ADD β€” Transparent objects are rendered using additive alpha blending. Opaque objects are rendered first, and transparent objects are rendered back to front with z-buffer updates disabled.
  • BLEND β€” Transparent objects are rendered using multiplicative alpha blending.

Multiplicative alpha blending is the blending type that is most often used to render transparent objects. The new pixel value is calculated as the old pixel color multiplied with one minus the source alpha value, plus the source pixel color multiplied with the source alpha value.

We recommend that you use this transparency mode if you have only one transparent object in your scene, and you know that it will be rendered after the opaque objects.

  • DELAYED_BLEND β€” Transparent objects are rendered using multiplicative alpha blending, in a second rendering pass with depth buffer updates disabled.

Use this transparency type when you have one transparent object, or several transparent object that you know will never overlap (when projected to screen). Since the transparent objects are rendered after opaque ones, you'll not have to worry about putting the transparent objects at the end of your scene graph. It will not be as fast as the BLEND transparency type, of course, since the scene graph is traversed twice.

  • SORTED_OBJECT_BLEND β€” Transparent objects are rendered using multiplicative alpha blending, Opaque objects are rendered first, and transparent objects are rendered back to front with z-buffer updates disabled.

Okay so use this transparency mode when you've got several transparent objects that you know might overlap (like, when they get projected onto the screen). This method is gonna cost you 1 + num_transparent_objects rendering passes. Path traversal is what's used when rendering transparent objects, of course, but it might still be slow if you've got a ton of state changes sitting before your transparent object. When you're in this mode, we recommend placing the transparent objects as early as possible in the scene graph to minimize traversal overhead. do it for the framerate bestie πŸ’–

SORTED_OBJECT_SORTED_TRIANGLE_ADD

This transparency type is a Coin extension versus the original SGI Open Inventor API. ✨

Transparent objects are rendered back to front, and triangles in each object are sorted back to front before rendering.

See the description for SORTED_OBJECT_SORTED_TRIANGLE_BLEND for more information about this transparency type.

SORTED_OBJECT_SORTED_TRIANGLE_BLEND

This transparency type is a Coin extension versus the original SGI Open Inventor API. ✨

Transparent objects are rendered back to front, and triangles in each object are sorted back to front before rendering.

Use this transparency type when you have one (or more) transparent object(s) where you know triangles might overlap inside the object. Ngl this transparency type might be very slow if you have an object with lots of triangles, since all triangles have to be sorted before rendering, and an unoptimized rendering loop is used when rendering. Lines and points are not sorted before rendering. They are rendered as in the normal SORTED_OBJECT_BLEND transparency type.

Please note that this transparency mode does not guarantee "correct" transparency rendering. It is almost impossible to find an algorithm that will sort triangles correctly in all cases, and intersecting triangles are not handled. Also, since each object is handled separately, two intersecting object will lead to incorrect transparency. not the vibe, but forewarned is forearmed 😭

NONE

This transparency type is a Coin extension versus the Open Inventor API.

Turns off transparency for objects, even if transparency is set using an SoMaterial node.

Since Coin 1.0

SORTED_LAYERS_BLEND

This transparency type is a Coin extension versus the original SGI Open Inventor API. ✨

By using this transparency type, the SoGLRenderAction will render normal and intersecting transparent objects correctly independent of rendering order. It is the only transparency type rendering mode which is guaranteed to do so. πŸ‘‘

This mode is different from all other modes in that it overrides the SoTransparencyType nodes in the scenegraph; all objects are drawn using SORTED_LAYERS_BLEND.

There are currently two separate code paths for this mode. Both paths are heavily based on OpenGL extensions. The first method is based on extensions which are only available on NVIDIA chipsets (GeForce3 and above, except GeForce4 MX). These extensions are GL_NV_texture_shader, GL_NV_texture_rectangle or GL_EXT_texture_rectangle, GL_NV_register_combiners, GL_ARB_shadow and GL_ARB_depth_texture. Please note that this transparency type occupy all four texture units on the NVIDIA card for all the rendering passes, except the first. Textured surfaces will therefore only be textured if they are not occluded by another transparent surface. iykyk 🫢

The second method utilise the GL_ARB_fragment_program extension. This extension is currently supported by the GeForceFX family and the Radeon 9500 and above. This technique is faster than the pure NVIDIA method. The fragment program method will automatically be chosen if possible. Please note that one should beware not to place the near-plane too close to the camera due to the lack of floating point precision control in fragment programs. Doing so may lead to loss of precision around the edges and 'jaggedness' of the transparent geometry. keep that near-plane in check fr fr πŸ’…

Setting the environment variable COIN_SORTED_LAYERS_USE_NVIDIA_RC to '1' will force the use of former code path instead of the latter, even if it is available.

A rendering context with >= 24 bits depth buffer and 8 bits alpha channel must be the current rendering context for this blending mode to actually become activated. If the current rendering canvas does not have these properties, Coin will fall back on a simpler transparency handling mode. If you are using one of the window-system binding libraries provided by Systems in Motion, e.g. SoXt, SoQt or SoWin, you will need to explicitly enable this in your viewer. See the API documentation of the setAlphaChannel() method of either SoXtGLWidget, SoQtGLWidget or SoWinGLWidget.

The detection of whether or not the SORTED_LAYERS_BLEND mode can be used will be done automatically by the Coin internals. If one or more of the necessary conditions listed above are unavailable, SoGLRenderAction::SORTED_OBJECT_BLEND will be used as the transparency type instead.

To be able to render correct transparency independent of object order, one have to render in multiple passes. This technique is based on depth-peeling which strips away depth layers with each successive pass. The number of passes is therefore an indication of how deep into the scene transparent surfaces will be rendered with transparency. A higher number will lead to a lower framerate but higher quality for scenes with a lot of transparent surfaces. The default number of passes is '4'. This number can be specified using the SoGLRenderAction::setSortedLayersNumPasses() or by letting the environment variable COIN_NUM_SORTED_LAYERS_PASSES or OIV_NUM_SORTED_LAYERS_PASSES specify the number of passes. four passes is the default bestie, memorize it 🧚

A more detailed presentation of the algorithm is written by Cass Everitt at NVIDIA;

"Interactive Order-Independent Transparency"
http:://developer.nvidia.com/object/order_independent_transparency.html

Since Coin 2.2

TGS Inventor 4.0


enum SoGLRenderAction::AbortCode

The return codes which an SoGLRenderAbortCB callback function should use.

See also setAbortCallback()

Enumerator

  • CONTINUE β€” Continue rendering as usual. keep it moving ✨
  • ABORT β€” Abort the rendering action immediately. yeet it πŸ’€
  • PRUNE β€” Do not render the current node or any of its children, but continue the rendering traversal. skip the branch, keep walking πŸ¦‹
  • DELAY β€” Delay rendering of the current node (and its children) until the next rendering pass. save it for next round ⭐

enum SoGLRenderAction::SortedObjectOrderStrategy

Enumerator

  • BBOX_CENTER β€” Do the sorting based on the center of the object bounding box.

See also setSortedObjectOrderStrategy().

Since Coin 2.5

  • BBOX_FARTHEST_CORNER β€” Do the sorting based on the bounding box corner farthest from the camera.

See also setSortedObjectOrderStrategy().

Since Coin 2.5

  • CUSTOM_CALLBACK β€” Use a custom callback to determine the sorting order.

See also setSortedObjectOrderStrategy().

Since Coin 2.5


Constructor & Destructor Documentation πŸŽ€

SoGLRenderAction::SoGLRenderAction (const SbViewportRegion & viewportregion)

Constructor. Sets up the render action for rendering within the given viewportregion.

References BBOX_CENTER, SCREEN_DOOR, and SoGLRenderAction().

Referenced by SoBoxHighlightRenderAction::addMethod(), addMethod(), SoLineHighlightRenderAction::addMethod(), and SoGLRenderAction().

SoGLRenderAction::~SoGLRenderAction (void ) [virtual]

Destructor, frees up all internal resources for action instance. clean up after yourself queen πŸ’…


Member Function Documentation ✨

SoType SoGLRenderAction::getTypeId (void ) const [virtual]

Returns the type identification of an action derived from a class inheriting SoAction. This is used for run-time type checking and "downward" casting.

Usage example:

void bar(SoAction * action)
{
  if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) {
    // safe downward cast, know the type
    SoGLRenderAction * glrender = (SoGLRenderAction *)action;
  }
  return; // ignore if not renderaction
}

For application programmers wanting to extend the library with new actions: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubAction.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR.

For more information on writing Coin extensions, see the SoAction class documentation.

Returns the actual type id of an object derived from a class inheriting SoAction. Needs to be overridden in all subclasses.

Implements SoAction.

Reimplemented in SoBoxHighlightRenderAction, and SoLineHighlightRenderAction.

void SoGLRenderAction::addMethod (const SoType type, SoActionMethod method) [static]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. ngl it's giving "you don't need this one" πŸ™ˆ

References SoAction::SoAction(), and SoGLRenderAction().

void SoGLRenderAction::enableElement (const SoType type, const int stackindex) [static]

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. same energy, internal-only bestie πŸ™ˆ

const SoEnabledElementsList & SoGLRenderAction::getEnabledElements (void ) const [protected], [virtual]

Returns a list of the elements used by action instances of this class upon traversal operations.

Reimplemented from SoAction.

Reimplemented in SoBoxHighlightRenderAction, and SoLineHighlightRenderAction.

void SoGLRenderAction::setViewportRegion (const SbViewportRegion & newregion)

Sets the viewport region for rendering. This will then override the region passed in with the constructor. constructor said one thing, this method said another β€” and this one wins πŸ’…

Referenced by SoSceneManager::setGLRenderAction().

const SbViewportRegion & SoGLRenderAction::getViewportRegion (void ) const

Returns the viewport region for the rendering action.

Referenced by SoSceneManager::setHandleEventAction(), and SoOffscreenRenderer::SoOffscreenRenderer().

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

Sets the area of the OpenGL context canvas we should render into.

The coordinates for origin and size should be normalized to be within [0.0, 1.0]. The default settings are <0.0, 0.0> for the origin and <1.0, 1.0> for the size, using the full size of the rendering canvas.

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

Returns information about the area of the rendering context window to be updated.

void SoGLRenderAction::setAbortCallback (SoGLRenderAbortCB *const func, void *const userdata)

Sets the abort callback. The abort callback is called by the action for each node during traversal to check for abort conditions. like a little vibe check for every node on the way through 🫢

okay so the callback method should return one of the SoGLRenderAction::AbortCode enum values, and that's literally how it tells the action how to proceed further. that's the whole vibe check. ✨

and here's the annoying part, bestie 😭 the client SoGLRenderAbortCB callback function only gets a single void* argument for the userdata. so if you wanna figure out which node the callback fired for, you gotta do some extra work. the move: pass the action pointer along as userdata, then call SoGLRenderAction::getCurPath(). the tail of that path is then the last traversed node. like this:

// set up so we can abort or otherwise intervene with the render
// traversal:
myRenderAction->setAbortCallback(MyRenderCallback, myRenderAction);

// [...]

SoGLRenderAction::AbortCode
MyRenderCallback(void * userdata)
{
  SoGLRenderAction * action = (SoGLRenderAction *)userdata;
  SoNode * lastnode = action->getCurPath()->getTail();

  // [...]
  return SoGLRenderAction::CONTINUE;
}

See also: SoGLRenderAction::AbortCode


πŸŽ€ setTransparencyType()

void SoGLRenderAction::setTransparencyType (const TransparencyType type)

sets the transparency rendering method for the transparent objects chillin' in the scene graph. πŸ’…

See also: SoGLRenderAction::TransparencyType


✨ getTransparencyType()

SoGLRenderAction::TransparencyType SoGLRenderAction::getTransparencyType (void) const

hands you back the transparency rendering type. that's it, that's the function. 🫢


🌸 setSmoothing()

void SoGLRenderAction::setSmoothing (const SbBool smooth)

sets (or unsets) smoothing. if the smoothing flag is on, Coin will try to use built-in features from the OpenGL implementation to smooth out the appearance of otherwise jagged line and point primitives, calling

glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);

...before rendering the scene. so basically a glow-up for your edges.

this is a simple (and computationally non-intensive) way of doing anti-aliasing. lowkey iconic for how cheap it is.

Default value for this flag is to be off.

πŸ¦‹ isSmoothing()

SbBool SoGLRenderAction::isSmoothing (void) const

tells you whether smoothing is set or not. yes/no, on/off, that kinda energy.


⭐ setNumPasses()

void SoGLRenderAction::setNumPasses (const int num)

sets the number of rendering passes. default is 1, and anything greater will enable antialiasing through the use of an OpenGL accumulation buffer. fancy fr fr.


πŸ’œ getNumPasses()

int SoGLRenderAction::getNumPasses (void) const

returns the number of rendering passes done on updates.

Referenced by: SoCamera::GLRender().


πŸ“ setPassUpdate()

void SoGLRenderAction::setPassUpdate (const SbBool flag)

sets whether each pass should render to screen or not. simple as that.


🌈 isPassUpdate()

SbBool SoGLRenderAction::isPassUpdate (void) const

returns the value of the "show intermediate updates" flag.

See also: setPassUpdate()


πŸ‘‘ setPassCallback()

void SoGLRenderAction::setPassCallback (SoGLRenderPassCB *const func, void *const userdata)

sets the pass callback. the callback is called between each rendering pass. so like, in-between the passes, not during. iykyk.


πŸ”₯ setCacheContext()

void SoGLRenderAction::setCacheContext (const uint32_t context)

sets the OpenGL cache context key, which is used for deciding when to share OpenGL display lists.

every SoGLRenderAction has a cache context id, and you can set it with SoGLRenderAction::setCacheContext(). the cache context id must be unique, so that different texture objects and display lists get created for uncompatible GL contexts. for instance, when SoGLRenderAction traverses an SoTexture2 node, the node checks if it has a texture object created for the cache context. if not, a new texture object will be created and used when rendering.

See also: SoGLCacheContextElement::getUniqueCacheContext()

References: invalidateState().


πŸ’– getCacheContext()

uint32_t SoGLRenderAction::getCacheContext (void) const

returns the cache context key for this rendering action instance.

Referenced by: SoBumpMap::GLRender(), SoIndexedFaceSet::GLRender(), SoIndexedLineSet::GLRender(), SoPointSet::GLRender(), SoTextureCombine::GLRender(), SoVRMLIndexedFaceSet::GLRender(), SoVRMLIndexedLineSet::GLRender(), SoVRMLPointSet::GLRender(), SoShape::shouldGLRender(), and SoShape::startVertexArray().


🧚 addDelayedPath()

void SoGLRenderAction::addDelayedPath (SoPath * path)

adds a path to the list of paths to render after the current pass. it's giving "hold that thought, we'll get to you". ⏳

References: SoAction::getState().

Referenced by: abortNow(), SoAnnotation::GLRenderBelowPath(), SoExtSelection::GLRenderBelowPath(), and SoAnnotation::GLRenderInPath().


πŸ’€ isRenderingDelayedPaths()

SbBool SoGLRenderAction::isRenderingDelayedPaths (void) const

returns a flag indicating whether or not we are currently rendering from the list of delayed paths of the scene graph. so like, are we in the delayed-paths era right now or not.

Referenced by: SoAnnotation::GLRenderBelowPath(), SoExtSelection::GLRenderBelowPath(), and SoAnnotation::GLRenderInPath().


🌟 handleTransparency()

SbBool SoGLRenderAction::handleTransparency (SbBool istransparent = 0)

used by shape nodes or others which need to know whether or not they should immediately render themselves or if they should wait until the next pass. the "do i go now or do i wait" dilemma 😭

References: ADD, BLEND, DELAYED_ADD, DELAYED_BLEND, SoAction::getCurPath(), SoAction::getState(), SoState::isCacheOpen(), NONE, SCREEN_DOOR, SORTED_LAYERS_BLEND, SORTED_OBJECT_ADD, SORTED_OBJECT_BLEND, SORTED_OBJECT_SORTED_TRIANGLE_ADD, and SORTED_OBJECT_SORTED_TRIANGLE_BLEND.

Referenced by: SoImage::GLRender(), and SoShape::shouldGLRender().


🎠 getCurPass()

int SoGLRenderAction::getCurPass (void) const

returns the number of the current rendering pass. where are we in the pass lineup bestie.


πŸ›‘ abortNow()

SbBool SoGLRenderAction::abortNow (void)

returns TRUE if the render action should abort now based on user callback.

See also: setAbortCallback()

References: ABORT, addDelayedPath(), CONTINUE, DELAY, SoAction::getCurPath(), SoFullPath::getLength(), SoBase::getName(), SoType::getName(), SbName::getString(), SoFullPath::getTail(), SoBase::getTypeId(), SoAction::hasTerminated(), PRUNE, and SoAction::setTerminated().

Referenced by: SoGroup::GLRender(), SoVRMLAppearance::GLRender(), SoVRMLCollision::GLRender(), SoVRMLShape::GLRender(), SoLOD::GLRenderBelowPath(), SoSeparator::GLRenderBelowPath(), SoVRMLBillboard::GLRenderBelowPath(), SoVRMLGroup::GLRenderBelowPath(), SoVRMLLOD::GLRenderBelowPath(), SoLOD::GLRenderInPath(), SoSeparator::GLRenderInPath(), SoVRMLBillboard::GLRenderInPath(), SoVRMLGroup::GLRenderInPath(), SoVRMLLOD::GLRenderInPath(), SoLOD::GLRenderOffPath(), and SoVRMLLOD::GLRenderOffPath().


πŸ“‘ setRenderingIsRemote()

void SoGLRenderAction::setRenderingIsRemote (SbBool isremote)

lets the SoGLRenderAction instance know if the application is running on the local machine or if the rendering instructions are being sent over the network. long-distance relationship rendering 🌐

the flag is used to optimize rendering. for instance, should the displaylist caching strategy be influenced by this flag to be more aggressive with the caching when rendering instructions are passed over the network. yes, more aggressive. go off.

Default value is FALSE. The value of the flag will not be changed internally from the Coin library code, as it is meant to be controlled from client code β€” typically from the SoQt / SoXt / SoWin / SoGtk libraries.

See also: getRenderingIsRemote()


πŸ›°οΈ getRenderingIsRemote()

SbBool SoGLRenderAction::getRenderingIsRemote (void) const

returns whether or not the application is running remotely.

See also: setRenderingIsRemote()


♻️ invalidateState() β€” [virtual]

void SoGLRenderAction::invalidateState (void)

invalidates the state, forcing it to be recreated at the next apply() invocation. out with the old, in with the fresh state πŸ’…

Reimplemented from SoAction.

References: SoAction::invalidateState().

Referenced by: setCacheContext(), and SoSceneManager::setGLRenderAction().


πŸ–ΌοΈ addPreRenderCallback()

void SoGLRenderAction::addPreRenderCallback (SoGLPreRenderCB * func, void * userdata)

adds a callback which is invoked right before the scene graph traversal starts. all necessary GL initialization is then done (e.g. the viewport is correctly set), and this callback can be useful to, for instance, clear the viewport before rendering, or draw a bitmap in the background before rendering etc. it's your lil pre-game ritual. ✨

The callback is only invoked once (before the first rendering pass) when multi pass rendering is enabled.

Please note that SoSceneManager usually adds a callback to clear the GL buffers in SoSceneManager::render(). So, if you plan to for instance draw an image in the color buffer using this callback, you should make sure that the scene manager doesn't clear the buffer. This can be done either by calling SoSceneManager::render() with both arguments FALSE, or, if you're using one of our GUI toolkits (SoXt / SoQt / SoGtk / SoWin), call setClearBeforeRender() on the viewer.

This method is an extension versus the Open Inventor API. (special πŸ’«)

See also: removePreRenderCallback().

Referenced by: SoSceneManager::render().


🧹 removePreRenderCallback()

void SoGLRenderAction::removePreRenderCallback (SoGLPreRenderCB * func, void * userdata)

removed a callback added with the addPreRenderCallback() method. bye bestie πŸ‘‹

This method is an extension versus the Open Inventor API.

See also: addPreRenderCallback()


πŸ§… setSortedLayersNumPasses()

void SoGLRenderAction::setSortedLayersNumPasses (int num)

sets the number of passes to render in SoGLRenderAction::SORTED_LAYERS_BLEND mode. default number of passes is 4. this number can also be adjusted by setting the COIN_NUM_SORTED_LAYERS_PASSES or OIV_NUM_SORTED_LAYERS_PASSES environment variable. env var girls stay winning. 🧚


🍰 getSortedLayersNumPasses()

int SoGLRenderAction::getSortedLayersNumPasses (void) const

returns the number of passes to render when in SoGLRenderAction::SORTED_LAYERS_BLEND mode.


🎯 setSortedObjectOrderStrategy()

void SoGLRenderAction::setSortedObjectOrderStrategy (const SortedObjectOrderStrategy strategy, SoGLSortedObjectOrderCB * cb = NULL, void * closure = NULL)

sets the strategy used for sorting transparent objects.

the CUSTOM_CALLBACK strategy enables the user to supply a callback which is called for each transparent shape. this strategy can be used if the built in sorting strategies aren't sufficient.

the callback should return a floating point value to be used when sorting the objects in Coin. this floating point value is interpreted as a distance to the camera, and objects with higher values will be sorted behind objects with lower values.

the callback will supply the SoGLRenderAction instance, and the path to the current object can be found using SoAction::getCurPath().

Since: Coin 2.5


πŸšͺ beginTraversal() β€” [protected], [virtual]

void SoGLRenderAction::beginTraversal (SoNode * node)

this virtual method is called from SoAction::apply(), and is the entry point for the actual scenegraph traversal. main character entrance energy, honestly. πŸšͺ✨

it can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting SoAction.

the default method just calls traverse(), which any overridden implementation of the method must do too (or call SoAction::beginTraversal()) to trigger the scenegraph traversal. don't skip that step, fr fr.

Reimplemented from SoAction.

References: SoAction::beginTraversal(), and SoDebugError::postWarning().


🏁 endTraversal() β€” [protected], [virtual]

void SoGLRenderAction::endTraversal (SoNode * node)

this virtual method can be overridden to execute code after the scene graph traversal. default method does nothing. it's the chill one. 😌

Reimplemented from SoAction.

References: SoAction::endTraversal().

✨ AUTHOR ✨

Okay bestie, plot twist: nobody wrote this page, like, with their hands and their heart. It was generated automatically by Doxygen for Coin from the source code. πŸ’…

So yeah β€” no moody artist, no tormented genius typing at 3am. Just Doxygen doing its little automated thing, pulling the docs straight out of the source code itself. Iconic, honestly. πŸŽ€


And that's a wrap on SoGLRenderAction(3)!! πŸ¦‹ You made it to the end of the whole thing, which is main character energy fr fr. This page came to you courtesy of Coin, Version 2.5.0 β€” keep it in your SEE ALSO heart forever. πŸ‘‘βœ¨

go render something beautiful, bestie πŸ’–

πŸ“¦ where this page comes from