David, > I saw this. Maybe I'm being daft, but presumably this only helps when you > have the SAME shader for the entire shadowed scene? I have a situation where > > the shadowed objects have a variety of different shaders. If I'm missing > something obvious, my apologies.
Thats true. But opposite scenario is also possible. You can link your main shaders in your object statesets with shadow shaders from StandardShadowMap. Just grab them from StandardShadowMap via getShadowVertexShader() & getShadowFragmentShader(). Make sure to call DynamicShadow functions in proper places of your main vertex shaders to compute shadow texture coords and call DynamicShadow in main fragment to get shadowing term. You may look at StandardShadow main shaders for reference. StandardShadowMap do not apply its shadow program with override attribute so if you actually have the shaders below ShadowedScene your shaders will be used. If you simply make sure call DynamicShadow function from your main you should be well and happy. Cheers, Wojtek
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

