Hi Guy,

Sorting Geometry by depth on each frame would be very expensive for
any other than trivial geometry.  You don't want to do, and the OSG
doesn't support it either.

Approaches you can take include:

 1) Break you geometry into smaller separate osg::Geometry so that
the coarse grained
     depth sorting can work more efficiently.

  2) Use a double pass approach where you draw the back faces first,
then draw the
      front faces.  You can achieve this by duplicating all your
primitives, swapping the
      primitives binding and then ordering them so the reverse
binding are first then
      the original bindings.  You also need to enable back face culling.

Robert.



On 6/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


Thanks to everyone that helped on the issue,
I also had some more readings about it, but the problem I have is that the
objects in the transparent bin are sorted by depth against each other but I
need the vetices to be sorted.

I'm having a drawable which contains many vertices and is transparent, from
some direction I see through the front of the object it's back correctly and
from the other direction it doesn't look correct (even when disabling depth
test, or setting depth mask to true/false), the problem is that the vertices
aren't drawn in the correct order and so the source alpha and destination
alpha are swapped. Is their a way to tell osg to sort the vertices of the
drawable depending on the viewing angle? is it VERY slow? any ideas?

thanks,
 Guy.

----- Original Message -----
From: Paul Martz
To: 'osg users'
Sent: Tuesday, June 19, 2007 7:22 PM
Subject: RE: [osg-users] Blending for dummies :)


Any geometries that blend against each other should be in separate
Drawables, and their StateSet should have the render bin hint set to
TRANSPARENT_BIN. OSG will then draw these Drawables after all opaque
Drawables and in back to front order. There are other strategies too, but
this is the simple common one.


For more information, there are many OSG examples that demonstrate how to
set up OSG for correct rendering of translucent objects. Also, check the
archives, as this has been covered multiple times recently.
 Hope that helps,


Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
303 859 9466


 ________________________________
 From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, June 19, 2007 12:15 PM
To: osg users
Subject: [osg-users] Blending for dummies :)



Hello,
 I'm trying to activate blending in some node. I set in the stateset
GL_BLEND on, and added osg::BlendFunc but it seems to work only from
backward views. I tried to disable GL_DEPTH and GL_CULL with no better
results.
any ideas?

thanks,
 Guy.

 ________________________________


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to