<div dir="ltr"><div><div><div>HI Alessandro,<br><br></div>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.<br><br></div>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.<br><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 August 2015 at 10:54, Alessandro Terenzi <span dir="ltr"><<a href="mailto:a.terenzi@gmail.com" target="_blank">a.terenzi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you again Robert for your explanation.<br>
<br>
So I tried to explicitly set some render bins but I am not sure to understand what happens now.<br>
<br>
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:<br>
<br>
1) if the bin number of the color-masked box is "lower" than the other then it hides the yellow box<br>
<br>
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<br>
<br>
I expected the opposite, am I wrong?<br>
<br>
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.<br>
<br>
Cheers.<br>
<span class="">Alessandro<br>
<br>
------------------<br>
Read this topic online here:<br>
</span><a href="http://forum.openscenegraph.org/viewtopic.php?p=64784#64784" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=64784#64784</a><br>
<br>
<br>
<br>
<br>
Attachments:<br>
<a href="http://forum.openscenegraph.org//files/bnm_122.osg" rel="noreferrer" target="_blank">http://forum.openscenegraph.org//files/bnm_122.osg</a><br>
<a href="http://forum.openscenegraph.org//files/b_o_129.osg" rel="noreferrer" target="_blank">http://forum.openscenegraph.org//files/b_o_129.osg</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</div></div></blockquote></div><br></div>