Hi Robert.
Sorry to post again.
But even using the ss->setRenderingHint( osg::StateSet::TRANSPARENT_BIN )
for all geometries a cannot guarantee that the Texts will be on screen.
- When I add to much components (nothing more than rects with texts inside)
on the screen my texts just simply fade away.
- If i add a small quantity widgets with texts inside and one widget with
LineStipple, all Texts fade away too.
As a test, just to see the osgText::Texts, i've made a second
configuration that looses the transparency of them but at least they are
showing on screen if their respective colors:
_text->getOrCreateStateSet()->setMode( GL_DEPTH,
osg::StateAttribute::OFF );
_text->getOrCreateStateSet()->setRenderingHint(
osg::StateSet::DEFAULT_BIN );
I'll restart to create the widget System using your first hint as base (
setRenderBinDetails( number_as_draw_order, "" ) ).
Scene results together with code:
Text without GL_DEPTH -
http://img215.imageshack.us/img215/2913/textwithoutgldepth.png
Text with GL_DEPTH -
http://img222.imageshack.us/img222/9679/textwithdepth.png
Regards
Andre
2009/12/15 Andre Simoes <[email protected]>
> Hello Robert.
>
> I never thought of the Depth buffer application under a 2D orthographic
> mode.
>
> After adding
> osg::StateSet *ss = getOrCreateStateSet();
> ss->setRenderingHint( osg::StateSet::TRANSPARENT_BIN );
> ss->setMode( GL_DEPTH_TEST, osg::StateAttribute::ON );
>
> to all my geometries osgText::Texts are being correctly displayed.
>
> Thanks
> Andre
>
> 2009/12/15 Robert Osfield <[email protected]>
>
>> Hi Andre,
>>
>>
>> On Tue, Dec 15, 2009 at 11:11 AM, Andre Simoes <[email protected]>
>> wrote:
>> > Hi Robert.
>> >
>> > In reality I'm not doing anything with the depth buffer since i never
>> used
>> > depth for a 2D projection in pure OpenGL programs.
>>
>> So.... you disable depth test?
>>
>> If you have depth test on then you will be using the depth buffer even
>> with 2D projections.. as 2D projections are really no different rather
>> 3D projections in OpenGL, everything in reality is 3D, everything has
>> depth even it's flat and depth value of 0, and if depth test is on
>> then each fragment will be tested against the depth buffer.
>>
>> > For a simple OpenGL program I just draw components in sequence. As an
>> > example like this:
>>
>> Again as I've been saying for the last three emails, depth test is the
>> key and still you haven't provide any information about it.
>>
>> Robert.
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org