[osg-users] OSG RenderBin reverse order

Bruno Oliveira bruno.manata.oliveira at gmail.com
Mon Nov 7 06:51:01 PST 2016


I'm using RenderBins to display overlapping textures that are contained in
separate geodes. All my geodes are at z = 0.f, so using a standard depth
test is not good for me. I need to use the RenderBin order, but I need to
reverse the order (i.e, if I give a binNum of 0 to a node, I want that node
to be rendered on top of everything, if I give a binNum of 1, is would be
under that first node, and so on. In other words, the bin Num I want to
give is the reverse order a bin is drawn. Is this possible?

I am using the following code:

  osg::StateSet ss = new StateSet;
  ss->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
  ss->setRenderBinDetails(depth, "DepthSortedBin");

By searching through the forum, I thought that using "DepthSortedBin" would
guarantee that the render order would be reversed, but it isn't. (By the
way it yields the same result of "RenderBin"), so I misunderstood this

How can I use reverse order of the RenderBin index?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161107/1fedf5ea/attachment-0002.htm>

More information about the osg-users mailing list