SOGLRENDERACTION(3iv)
π
SoGLRenderAction β from the SoGLRenderAction(3IV) manual, bestie
okay so real talk, this page is the SoGLRenderAction(3IV) one, and it's about the class that literally paints your scene graph onto the screen with OpenGL. iconic behavior. let's get into it π¨β¨
π NAME
SoGLRenderAction β renders a scene graph using OpenGL. that's it, that's the job. main character energy fr fr π
𧬠INHERITS FROM
SoAction > SoGLRenderAction
so it's got all the SoAction stuff baked in, plus its own little renderer glow-up. iykyk π«
β¨ SYNOPSIS
#include <Inventor/actions/SoGLRenderAction.h>
typedef AbortCode SoGLRenderAbortCB(void *userData)
typedef void SoGLRenderPassCB(void *userData)
π the TransparencyType enum
enum TransparencyType {
SoGLRenderAction::SCREEN_DOOR
Uses stipple patterns for screen-door
transparency
SoGLRenderAction::ADD Uses additive alpha blending
SoGLRenderAction::DELAYED_ADD
Uses additive blending, rendering all
transparent objects after opaque ones
SoGLRenderAction::SORTED_OBJECT_ADD
Same as DELAYED_ADD, but sorts transparent
objects by distances of bounding boxes
from camera
SoGLRenderAction::BLEND Uses multiplicative alpha blending
SoGLRenderAction::DELAYED_BLEND
Uses multiplicative alpha blending,
rendering all transparent objects after
opaque ones
SoGLRenderAction::SORTED_OBJECT_BLEND
Same as DELAYED_BLEND, but sorts transparent
objects by distances of bounding boxes
from camera
}
so like, pick your transparency vibe: stipple it, add it, blend it, delay it, or sort it by distance from the camera. each one is giving a different aesthetic π¦
π the AbortCode enum
enum AbortCode {
SoGLRenderAction::CONTINUE Continue traversal as usual
SoGLRenderAction::ABORT Stop traversing the rest of the graph
SoGLRenderAction::PRUNE Do not traverse this node or its
children, but continue
SoGLRenderAction::DELAY Delay rendering of this node until the
second pass
}
these are the four moods you can return from an abort callback. yes bestie, you get to decide when the traversal stops. the power. π
π«Ά Methods from class SoGLRenderAction
SoGLRenderAction(const SbViewportRegion
&viewportRegion)
void setViewportRegion(const SbViewportRegion
&newRegion)
const SbViewportRegion & getViewportRegion() const
void setUpdateArea(const SbVec2f &origin, const
SbVec2f &size)
void getUpdateArea(SbVec2f &origin, SbVec2f &size)
const
void setAbortCallback(SoGLRenderAbortCB *func, void
*userData)
void setTransparencyType(TransparencyType type)
TransparencyType getTransparencyType() const
void setSmoothing(SbBool smooth)
SbBool isSmoothing() const
void setNumPasses(int num)
int getNumPasses() const
void setPassUpdate(SbBool flag)
SbBool isPassUpdate() const
void setPassCallback(SoGLRenderPassCB *func, void
*userData)
void setCacheContext(uint32_t context)
uint32_t getCacheContext() const
π Methods from class SoAction
virtual void apply(SoNode *node)
virtual void apply(SoPath *path)
virtual void apply(const SoPathList &pathList, SbBool obeysRules =
FALSE)
static SoType getClassTypeId()
virtual SoType getTypeId()
virtual SbBool isOfType(SoType type)
virtual void invalidateState()
πΈ DESCRIPTION
okay so this class literally walks a scene graph and renders it using the OpenGL graphics library. it's assuming a valid window has already been created and initialized for proper OpenGL rendering β like, it's not gonna build the window for you, bestie, that's not its era. if you need that, the SoXtRenderArea class (or literally any of its subclasses) can make you such a window πͺβ¨
π METHODS
SoGLRenderAction(const SbViewportRegion &viewportRegion)
Constructor time!! π The parameter defines the viewport region into which rendering will take place. that's the canvas, the little rectangle of reality where the pixels live.
void setViewportRegion(const SbViewportRegion &newRegion) / const SbViewportRegion & getViewportRegion() const
Changes/returns viewport region to use for rendering. swap it out, check what it is, no big deal π«
void setUpdateArea(const SbVec2f &origin, const SbVec2f &size) / void getUpdateArea(SbVec2f &origin, SbVec2f &size) const
Sets/returns the current update area, which is the rectangular area of the viewport region that will actually be rendered into. so like, the part you're actually bothering to redraw. this can be used for partial updates in applications that can manage them β i.e. if you're clever enough to only repaint the bit that changed, this is your girl ποΈ
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. so origin + size, normalized, boom. π―
void setAbortCallback(SoGLRenderAbortCB *func, void *userData)
Sets callback to call during rendering to test for an abort condition. It will be called for each node that is traversed. this is your little "should i keep going??" checkpoint β
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 Inventor's default order of rendering objects in a scene graph. so you can literally reorder the render pipeline if you feel like it. not me flexing π€
void setTransparencyType(TransparencyType type) / TransparencyType getTransparencyType() const
Sets/returns transparency quality level to use when rendering. The default is SCREEN_DOOR. πͺβ¨
Note that SCREEN_DOOR transparency does not work in the case where transparency values are specified for each vertex of a shape. If this is the case, use one of the other transparency types. bestie pls do not fight this, just pick another one π
void setSmoothing(SbBool smooth) / SbBool isSmoothing() const
Sets/returns smoothing flag. When on, smoothing uses OpenGL's line- and point-smoothing features to provide cheap antialiasing of lines and points. cheap and cute, we love a budget-friendly glow-up π The default is FALSE.
void setNumPasses(int num) / int getNumPasses() const
Sets/returns number of rendering passes for multipass rendering. 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 is 1 pass. so yeah, more passes = prettier = slower. choose your struggle π
void setPassUpdate(SbBool flag) / SbBool isPassUpdate() const
Sets/returns a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement (default is FALSE). turn it on and watch the render get hotter pass by pass π
void setPassCallback(SoGLRenderPassCB *func, void *userData)
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. so no callback = automatic buffer wipe, no thoughts head empty π§Ό
void setCacheContext(uint32_t context) / uint32_t getCacheContext() const
Sets/returns 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. it's literally just a number, but that number is doing lore-relevant work π’
π SEE ALSO
SoSeparatorSoXtRenderArea
go read those too, they're in the same friend group π«Ά
and that's the whole page bestie, no cap, every single flag and default accounted for. this was the SoGLRenderAction(3IV) manual page β that's the title, that's the footer, that's the whole vibe πβ¨ slay responsibly, and remember: SCREEN_DOOR is the default but it's not gonna save you on per-vertex transparency. periodt. π
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms