[osg-users] ColorMask and depth information issue.

Robert Osfield robert.osfield at gmail.com
Sat Aug 15 06:58:22 PDT 2015

HI Alessandro,

I've read you're email but not looked at the files at from your explanation
you seem to be heading off in the wrong direction.

My guess is that you should be setting the RenderBinNum of the Occluder
subgraph which set the ColorMask(false, false,false,false) to -1 to force
it to draw before other parts of the scene graph.  The rest of the scene
graph you can just leave things in the default (opaque) state sorted bin
(the default constructed "RenderBin" is state sorted, BinNum 0).
Transparent objects you should put in a DepthSortedBin, when you use the
StateSet::setRenderingHint(TRANSPARENT_BIN) it'll select a "DepthSortedBin"
with BinNum 10.  The transparent bin is therefore draw last which helps
ensure the blending as far as possible to do correctly.


On 15 August 2015 at 10:54, Alessandro Terenzi <a.terenzi at gmail.com> wrote:

> Thank you again Robert for your explanation.
> So I tried to explicitly set some render bins but I am not sure to
> understand what happens now.
> I am attaching 2 files: the yellow box and a blue box to which I apply the
> color mask. I modified both files in order to use the same render bin
> number and name ("RenderBin"), what I observe is:
> 1) if the bin number of the color-masked box is "lower" than the other
> then it hides the yellow box
> 2) if the bin number of the color-masked box is "higher" than, or equal
> to, the other then it does NOT hide the yellow box
> I expected the opposite, am I wrong?
> Also, if instead of using "RenderBin" I use "DepthSortedBin" then the
> behavior is similar but, in the case where the bin numbers are equal, then
> the occlusion works only up to a certain viewing angle.
> Cheers.
> Alessandro
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64784#64784
> Attachments:
> http://forum.openscenegraph.org//files/bnm_122.osg
> http://forum.openscenegraph.org//files/b_o_129.osg
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150815/acaaf1ed/attachment-0003.htm>

More information about the osg-users mailing list