osgText::Text uses a font texture map with alpha values to encode the glyph, and text is drawn as a textured quad with blending enabled.

Because of the use of alpha and blending, osgText::Text implicitly places text quad geometry in the transparent RenderBin. This is what you typically want for any kind of translucent rendering -- unless you've disabled depth and are using painter's algorithm, like you are doing.

You could turn depth test on and let depth handle the layering.

If you want to continue to use painter's algorithm, then you need to force the Text into the opaque bin. See StateSet::setRenderBinDetails for the various options; you should find a flag there that tells the CullVisitor to not switch to another bin as it traverses the subgraph during cull. You'd just need to set the render bin to the default bin, and add this override flag, at some Group node above your Text. If you do this correctly, the Text request to be placed in the transparent bin will be ignored by the CullVisitor.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466



stefan nortd wrote:
Hi,

I am working on a widget system and have problems with how osgText:Text
is layered. My text always ends up above the geometry. I have a root node that has depth testing disabled. Under it is a hierachy of rectangle-like panels. Some of them have text labels. All my geometry layers as expected but the text always stays in front of everything else.

Text with text layers correctly too.

Any ideas why this happens?


Cheers,
stefan

------------------------
stefan hechenberger

http://linear.nortd.com

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





------------------------------------------------------------------------


------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to