[osg-users] question about custom shaders with osgShadow

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Fri Jul 18 11:11:00 PDT 2008


Hello Denis,

> Is there a way to use custom shaders with osgShadow?

Yes, if you're using osgShadow::ShadowMap :

osgShadow::ShadowMap::clearShaderList();
osgShadow::ShadowMap::addShader(fragmentShader.get());
osgShadow::ShadowMap::addShader(vertexShader.get());

Check src/osgShadow/ShadowMap.cpp (static const char 
fragmentShaderSource_withBaseTexture) for the default shader that is 
used, and use that as a base for your shader that would combine shadows 
and whatever else you want to do.

Hope this helps,

J-S
-- 
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com
                                http://www.cm-labs.com/
                         http://whitestar02.webhop.org/



More information about the osg-users mailing list