Hello Denis,
Is there a
way to get Shadow texture from osg ShadowMap and pass it to another
shader? Am I going in a right direction? Should I use osg ShadowMap to
get shadow texture and pass it to different shaders or something else?
I definitely think you should use osgShadow::ShadowMap if that saves you
having to reimplement the same thing yourself!
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.
Remember that lighting in CG is just a product (multiplication) of
different values, and so you can multiply the value you get from the
shadow2DProj() function call with other colors to get the result you want.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org