Hi Mail,

as far as I know the osgShadow do use already shaders for its implementation. 
Hence if you add a shader you autmaticly cacnels the shadows.

To solve that you could try to merge the osgShadow shader code and your own. 
However you have also to take care about all the uniforms which osgShadow sets.

Best regards,
Art


--- Mael Blanchard <[EMAIL PROTECTED]> schrieb am Do, 22.5.2008:

> Von: Mael Blanchard <[EMAIL PROTECTED]>
> Betreff: [osg-users] Adding a shader cancels shadows!
> An: "osg-users" <[email protected]>
> Datum: Donnerstag, 22. Mai 2008, 15:05
> Hi,
> 
> I had a *GLSL shader* in a scene with shadows, that use a
> *osg::**
> shadowedScene* and it doesn't work. What is the
> problem?
> Can I combine my GLSL shader and a shadowed scene??
> 
> I test it in the *osgshadow.cpp* example, i had this sample
> of code
> (with the basic shader of phong, with no texture) :
> 
> ...
>   while(arguments.read("--with-shader")) {
> withShader = true; }
>   if(withShader)
>   {
>    osg::ref_ptr<osg::Program> programObject = new
> osg::Program;
> 
>    std::string  repShad =
> "C:\\SHADERS\\";
> 
>    osg::ref_ptr<osg::Shader> phongVertexObject =  
> new osg::Shader(
> osg::Shader::VERTEX );
>    osg::ref_ptr<osg::Shader> phongFragmentObject =
> new osg::Shader(
> osg::Shader::FRAGMENT );
> 
>    loadShaderSource( phongVertexObject.get(),   repShad +
> "phong.vert" );
>    loadShaderSource( phongFragmentObject.get(), repShad +
> "phong.frag" );
> 
>    programObject->addShader( phongVertexObject.get() );
>    programObject->addShader( phongFragmentObject.get()
> );
> 
>   
> scene->getOrCreateStateSet()->setAttributeAndModes(programObject.get(),
> osg::StateAttribute::ON);
>   }
> ...
> 
> My shader works, but it *cancels shadows*!! :( Help me!
> 
> Thanks in advance,
> Mael._______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


      __________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to