[osg-users] Draw two translucent geometries in specific order

Kristofer Krus kristofer.krus at liu.se
Fri May 18 09:04:51 PDT 2018


Thanks for the reply Robert! I think the concept of render bin sounds logical, but I'm slightly confused about how RenderBins work in OSG (OpenSceneGraph). I’ve tried to find information about what RenderBins are and how to use them, but what I’ve been able to find so far has been limited, so I still have some questions about them:

1. Why does a bin have both a number and a name? Wouldn’t just one of those be enough as an identifier?

2. The article http://www.bricoworks.com/articles/stategraph/stategraph.html seems to imply that there are two default RenderBins: One with number 0 in which OSG puts all opaque objects and one with number 10 in which it puts all translucent objects. Is that how it works?

3. What are the names of those bins? (Or is that unimportant?)

4. How does OSG determine whether an object is translucent in order to put it into the correct bin? Does it look at all the colors and textures that are associated with the object and check whether at least some polygon or some pixel is translucent?

5. Will OSG’s choice of RenderBin to put each object in, based on translucency, be overridden if I use setRenderBinDetails (http://public.vrac.iastate.edu/vancegroup/docs/OpenSceneGraphReferenceDocs-3.0/a00762.html#a498095c3811e00b2fc6123a24ef5ec81)? I see that this method also takes an optional mode (http://public.vrac.iastate.edu/vancegroup/docs/OpenSceneGraphReferenceDocs-3.0/a00762.html#a43d4fd1ed6001ab862e89e7c4e877ff1). Does this variable have something to do with that? What does it do?

6. When I call setRenderBinDetails, if I specify a bin number that doesn’t exist, will this create a new bin?

7. If a bin with than number already exists, will the function call change the name and mode of that bin?

8. In your reply, you used the numbers 5 and 6. Was there some reason you did so, or was the choice of numbers arbitrary?

Finally, is there some other source, except from http://www.bricoworks.com/articles/stateset/stateset.html and http://www.bricoworks.com/articles/stategraph/stategraph.html (and the OpenSceneGraph source code) that you can recommend that explains how render bin works in OpenSceneGraph in greater detail?


Read this topic online here:

More information about the osg-users mailing list