Hello Jean-Sebastien,
Check the top of the shader in src/osgShadow/ShadowMap.cpp, there is a bunch of uniforms with names that start with "osgShadow_". You can use those same variable names in other shaders, and you will then have access to the same data (as long as the shader is on a node in the subgraph under the ShadowedScene node). The sampler is the shadow map itself, and the others are parameters. So you can use the same code and just combine it with whatever else you want to do.
Thanks for clarifying those things. I followed your suggestion and I was able to access all the "osgShadow_" uniforms when I added only fragment shader. When I added vertex shader, the object was not shadowed properly (with the same exact fragment shader). I suspect I'm doing something wrong with the texture coordinates in a vertex shader. I looked in ShadowMap.cpp, it has only fragment shaders. Do you know where can I find default vertex shader?
Thank you for your time, Denis _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org