SmallChange
1.0.0
A collection of extensions to Coin3D
|
The SmTextureText2Collector node is a group node which optimizes SmTextureText2 rendering. More...
#include <nodes/SmTextureText2Collector.h>
Public Member Functions | |
virtual void | GLRenderBelowPath (SoGLRenderAction *action) |
virtual void | GLRenderInPath (SoGLRenderAction *action) |
Static Public Member Functions | |
static void | initClass (void) |
Public Attributes | |
SoSFBool | depthMask |
Protected Member Functions | |
virtual void | renderText (SoGLRenderAction *action, const std::vector< SmTextureText2CollectorElement::TextItem > &) |
The SmTextureText2Collector node is a group node which optimizes SmTextureText2 rendering.
Since SmTextureText2 has antialiased rendering, it needs to render the text in a separate blending pass in Coin. This makes rendering slow if you have lots of SmTextureText2 nodes in your scene graph, and you use the SORTED_OBJECT_BLEND or DELAYED_BLEND transparency modes.
SmTextureText2 will also invalidate render and bounding box caches every time the camera moves. In addition, you might get quite a lot of OpenGL state changes when rendering the SmTextureText2 nodes in between other geometry.
To solve these problem, it's possible to use this node to optimize text rendering. It will collect all strings from all SmTextureText2 nodes in its subgraph, and render all strings before exiting.
A typical scene graph might look like this:
Please note that this node will only be able to optimize SmTextureText2 nodes where the number of positions equals the number of strings.