I analyzed the situation further and noticed that the problem seems to  
occur when Depth Testing is disabled. In that case, the rectangles for  
stenciling seem to either not be drawn at all, or more likely, maybe not  
in the order I specified.

Is it possible that the drawing order of the Drawables is changed by the  
scene graph? As osgText::Text is textured and all my other drawables are  
not, could that be a reason for such a reordering (especially with Depth  
Test disabled)?

Would there be an option to disable such reordering, if that could be the  
problem?

Regards,
Christian

On Sat, 12 Apr 2008 14:41:41 +0200, Christian Kaeser <[EMAIL PROTECTED]>  
wrote:

> Hello everyone,
>
> I encountered a problem that seems to stem from stenciling osgText::Text  
> -
> if I do this, the Text will not be drawn at all.
>
> Here more details of how my setup works:
>
> I am writing a GUI system that uses stencils to limit the drawing area  
> for
> components stacked in another component (just like in any desktop GUI -
> brings huge advantages for implementing scrollable lists etc):
>
>    1. Parent component increments the stencil buffer for its child area  
> by
> drawing a rectangle with osg::Geometry
>       It is added to the parent's osg::Group
>    2. Every child activates stencil testing, for the current stencil  
> value
>    3. All children add their osg::Geodes/osg::Groups to the parent
> component's osg::Group
>    4. Parent decrements the stencil buffer for the child area by drawing  
> the
> same rectangle
>       It is added to the parent's osg::Group
>
> It (recursively) works fine for the osg::Geometry objects I draw, they  
> get
> cut off outside the allowed area.
>
> But now I added osgText::Text, and it does not work at all - no text is
> drawn, not even the bounding boxes or the alignment pointer thing that  
> can
> be additionally drawn!
> If I disable the stencil testing (Point 2) for the text component, it
> draws just fine, but of course potentially outside the parent area.
>
> Do you have any idea what the reason for this behaviour could be? I can
> create a code example that reproduces the problem if that would help.
>
> Thanks in advance,
> Christian
> _______________________________________________
> 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