> what is the right way to implement a "render depth first" 
> pass? Is there some demo code for that?
> 
> I'm using some complex shaders which would benefit a lot of 
> being z-culled. Some parts of my geometry is transparent, so 
> I'm using the opaque and transparent render bins.

You can setSortMode() on the RenderBins that you're using.

  RenderBin* rb = RenderBin::getRenderBinPrototype("RenderBin");
  rb->setSortMode(SORT_FRONT_TO_BACK); 

In the code above, "RenderBin" == the opaque bin. You probably don't want to
change the sorting method used by the transparent bin (but if you do, it's
name is "DepthSortedBin" -- it sorts back to front by default).

In the past, I've had to create my own sorting method. To implement this, I
created my own custom RenderBin and overrode sortImplementation(). This is
really overkill for what you're doing.

Hope that helps,

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

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to