[osg-users] Clipping osgText::Text

Chris Djali krizdjali at gmail.com
Fri Oct 25 07:08:30 PDT 2019


Hi,

It might not necessarily be fast, as you'd be changing state that would normally stay the same between consecutive draw calls, but you could also change the scissor rectangle to the region you want to keep, or you could draw a rectangle with the same depth as the text, then set the depth test to equal, then draw the text. Other options include adding discards to the fragment shader when the fragment is outside the rectangle (which can sometimes make all draw calls that frame slower, not just the current one, especially on tiled renderers like mobile GPUs and post-Maxwell Nvidia cards, so you'll want to avoid this, too).

Cheers,
Chris

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76859#76859







More information about the osg-users mailing list