Hello Jason,

I'm trying to understand how the OSG ShadowMap class works on a frame by frame 
basis. I understand that the shadow is computed when the Cull Visitor hits the 
ShadowedScene node, which has the ShadowMap technique set to it.

That's right.

Right now, adding the Shadow technique and supplying it with the light to use, 
as well as the texture size doesn't seem to be doing anything, as in the scene 
is exactly the same with or without the shadow technique being applied to the 
root ShadowedScene node.

Does the osgShadow example work for you? If so then follow what that example does and it should work the same in your own code.

Which shadow technique are you using? osgShadow::ShadowMap or osgShadow::StandardShadowMap?

one gotcha is that we aren't calling .frame(), instead we are manually calling 
updateTraversal() and renderingTraversals() on the viewer, due to some changes 
we needed to make to not have the back buffer automatically flip at the end of 
a render. Is this skipping something that we will need to do, or should I look 
elsewhere for the cause of the issue?

We also don't use viewer.frame(), so I don't think that's the issue.

Also, in a more general sense, how are the uniforms and shaders propogated down 
the scene? After looking around the Shadow Map code, I can't seem to understand 
how those get applied on each frame to the children of the node, I'm sure I'm 
missing something blindingly obvious in this regard.

Uniforms propagate down the scene graph the same way as StateAttributes do, i.e. they are gathered during the cull traversal and uniforms lower in the graph will override uniforms of the same name higher up.

Does that help your general understanding? If you set a breakpoint in the osgShadow::ShadowMap::cull() method you should be able to see if it's being traversed correctly, and trace to see if it's traversing your scene as well.

Frequent stumbling blocks for shadow techniques in general are the node masks, and the scene bounds. In particular, a non-view-dependent shadow map technique will struggle with large scenes, and it could even happen that your shadow map texels are so large that you won't see much difference with the shadow and without. You could do a simple test with a small ground plane and one object on it, to eliminate that problem. If that works, then reduce the number of objects that contribute to the shadow map in order to reduce the size of the scene that the shadow map needs to fit.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to