[osg-users] RenderingHint vs binNumber(RenderBinDetails)

Christophe Medard christophe.medard at oktal.fr
Wed Oct 17 07:54:27 PDT 2007


Hi all,

Generalizing my 3 pass logic on a group of models, it seems I don't get the expected result.

Let me ask a question. In the following case :



am I correct if I assume the rendering order will be A1-A2-...-An-B-A1(with B context)-A2(with B context)-...-An(with B context)-C-A1(with C context)-A2(with C context)-...-An(with C context) , in each {A1-A2-...-An} sequence, precise order being unassumable ?

By "with B context" I mean "having stateset attributes inherited from B stateset ones". 

If not, what would be a correct way to give rise to this render order ??

Thanks for any teaching about this.

-- 
Christophe Médard
Société OKTAL (http://www.oktal.fr)
2 impasse Boudeville
31100 Toulouse (France)
Tél. : (+33) 5 62 11 50 10
Fax : (+33) 5 62 11 50 29


----- Original Message ----- 
From: Christophe Medard 
To: OpenSceneGraph Users 
Sent: Friday, October 05, 2007 3:55 PM
Subject: Re: [osg-users] RenderingHint vs binNumber(RenderBinDetails)


Yop,

All right, Tim's right.

So to conclude :
- setRenderingHint is just a shortcut for setRenderBinDetails, it allows not to have to specify the name of bin type, and _renderingHint is useless (for those making inquiries on the OSG source)
- indeed, the binNumber is the draw order number against other children in the parent Group, evaluated in a left-first traversall logic. 

The draw order for this case (3 pass on an geode) is A-B-C. It works well, one just have to beware of z-fighting, through the reuse of the depth buffer of the 1st pass (via setAttributeAndModes(new osg::Depth(osg::Depth::EQUAL,0.0,1.0,false) for example).


       |
  osg::Group "Root"
       |
       -----------------------------------
       |                   |                               |
       |                   |                               |
       |        osg::Group "B"           osg::Group "C"
       |        [binNumber = 20]      [binNumber = 30]
       |                 |                                |
       ----------------------------------
               |
     osg::Geode "A"
     [binNumber = 15]


Thanks to all.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071017/76b06b98/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 34259 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071017/76b06b98/attachment-0003.jpeg>


More information about the osg-users mailing list