Jefferson,

I'm sure that Jean-Sebastien or Wojciech can answer better and more
correctly than me, but in the meantime...

Firstly, I notice that you are using OSG 2.6. The versatility of the API
into the shadowing stuff is much better in the 2.7 versions, and allows you
better control over what is being applied, so I recommend you move to that
if you can.

Secondly, in 2.6 at least, the only flag (castsShadow or receivesShadow)
that is "honoured" by the shadowedScene's subgraph is the castsShadow one.
Hence if things cast shadows they will also "receive" shadows.

However, in your example, it is only the default fragment shader applied by
the shadow map, in the end, which is "shading" your cars, so one way around
it is to reset/force the fragment shader on your cars to one that doesn't
try to do the lookup in the shadow texture. You can't do this at the
shadowMap level (as this would then be applied to everything including your
buildings), but you can do it to the cars individually. Create a shader -
you can use the GLSL in ShadowMap.cpp as a starting point - and then bind it
to your car node stateset with the "usual" methods

Hope that helps,

David
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to