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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to