[osg-users] Adding a shader cancels shadows!

2008-05-22 Thread Mael Blanchard
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_ptrosg::Program programObject = new osg::Program;

   std::string  repShad = C:\\SHADERS\\;

   osg::ref_ptrosg::Shader phongVertexObject =   new osg::Shader(
osg::Shader::VERTEX );
   osg::ref_ptrosg::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


[osg-users] put a uniform array in my GLSL shader ?

2007-09-11 Thread Mael Blanchard
Hi all,
I would like to put in my GLSL shader a uniform array variable,
I know how to put a simple float or int value with osg::Uniform, but for an
array I don't know
Is anyone can help me?

thanks

Mael.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org