[osg-users] question about custom shaders with osgShadow

Denis Nikolskiy nikolski at arsc.edu
Fri Jul 18 10:36:55 PDT 2008


Hi all,

Is there a way to use custom shaders with osgShadow? I’m using 2.5  
version of osg. I have a shader that computes a procedural texture,  
which is applied to an object. I wanted to use osgShadow::ShadowMap  
to get shadow applied to the same object, but I cannot find a way to  
pass the shadow texture to my shader. It looks like the shadow  
example shows how to use different shadow techniques only with fixed  
graphics pipeline functionality. Osg ShadowMap works great if I don’t  
use shaders. I know that one way to do shadow maps would be to set up  
a camera from the point of view of the light to render the world into  
a texture and send the texture to the shader. The osg ShadowMap code  
does the same thing, but I couldn’t find a way to get texture from it  
nor substitute the shader that it uses without changing osg  
ShadowMap. I looked at the documentation, source code, and on the web  
but I didn’t find anything that could help. Am I missing something?  
Could anyone push me in the right direction?

Thank you in advance for your time!

Denis


More information about the osg-users mailing list