Gordon, thanks, that clears up the first part, a default Camera mask of 0xffffffff explains why any non-zero node mask is rendered.
I fear that also means, in the second question below, that the CastsShadow bit _does_ need to be set for every parent along the nodepath. Otherwise, a "visitor" recursive descent of the scene graph will quit as soon as it encounters any node, like a Group or LOD, that does not have the CastsShadow bit set. Can anyone who understands osgShadow's NodeVisitors comment? If it's true, then that's a very big consideration in how scene graphs must be constructed to use osgShadow, and i can document it. -Ben > -----Original Message----- > From: Gordon Tomlinson > Sent: Wednesday, May 14, 2008 4:56 PM > > I can answer the Node Mask > See http://www.vis-sim.com/imgdp/vp_rendermasks_01.jpg > http://www.vis-sim.com/imgdp/vp_rendermasks_01a.jpg > > So in this case the Camera will have a default mask of 0xfffffff so a > logical AND apart from 0x0 will produce true result, eg 0x00000010 & > 0xffffffff results in 0x00000010 etc while 0xffffffff & 0x00000000 will > produce 0x00000000 false etc... > __________________________________________________________ > > > -----Original Message----- > From: Ben Discoe > Sent: Wednesday, May 14, 2008 10:35 PM > > There's something i'm not understanding about osgShadow, and it's probably > a basic behavior of OSG. > > So, the simple question first: > The default node mask for all nodes is 0xffffffff. > It i set the mask to 0, then the node (and its children) is not drawn. > If i set the mask to some other value, then it seems to be drawn also. So > what is OSG testing for, mask!=0? The NodeVisitor code seem to deal with > bit masks. So is there some specific bit (high bit, perhaps?) in the node > mask which says "draw me"? > > This relates to osgShadow's CastsShadowTraversalMask. > Let's say it's set to 1. > In the simple case (like example osgshadow) of a ShadowedScene with some > children, it's clear how it will behave: nodes with the 0x1 bit set in > their mask will cast shadows. > But, what if there is a large complex scene graph? > Nodes A and B are far apart in the graph. The ShadowedScene node is up at > the top of the graph. If we want A to shadow B, then we need to set the > appropriate bits in the node mask of A and B, and un-set them for > everything else. But, will the node traversal (of the ShadowTechnique) > ever reach A and B, to test if they have CastsShadowTraversalMask set? > Or does every parent along the nodepath need the flag set also? > > If that's true, then for this to be useful, we'd need some iteration code > (NodeVisitors, presumably) to set up the scene graph, clearing the mask > bits everywhere, and then starting with the ShadowCasting nodes, walking > upwards setting the CastsShadowTraversalMask bits along the way, until > it reaches ShadowedScene? > > If anyone can answer these, i am happy to add an explanation the osgShadow > wiki docs. > > Thanks, > Ben _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org