Shadow people,

I would like to render a scene that has some nodes in it that should not receive a shadow, and also some nodes that should neither cast nor receive a shadow but still be rendered. From looking at the code it appeared to me that ReceivesShadowTraversalMask was the thing to control this, however on closer inspection I find that only the MinimalDrawBoundsShadowMap and ShadowTexture techniques use this mask in any way. Of these two only ShadowTexture uses this mask to control decoration of the main scene traversal.

The ShadowTexture technique does two consecutive traversals of the main scene using the normal (non RTT) camera. One with a logical and of the main cull traversal mask and the receives shadow traversal mask and another with a logical and of the main cull traversal mask and the casts shadow traversal mask. As far as I can see this has two drawbacks, firstly that nodes with active bits umasked by both the receives shadow (&cull) mask and the casts shadow (&cull) mask will be rendered twice (Is this true, or have I missed something?), and secondly nodes with no active bits in either mask will not be rendered at all.

I started thinking of ways I could fix this (in ShadowTexture for a start!) but have come to a stop. Does anyone have any ideas on how to approach it. The most promising way I have so far is to do the main scene traversal with a derived version of osgUtil::CullVisitor but the complexity of transferring state from one cull visitor to another has defeated me.

My apologies in advance if I have missed something obvious. But for the time being it looks like I will have to put up with shadows on my selection highlights and translucent geometry :-)

Roger
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to