Hi Farshid,

What you are doing should work, I haven't tried it personally though...

There are dirty mechanism in Program that should detect this change, so I'd recommend that you just put some debugging code into osg::Program and see what happens.

Robert.

On 9/8/06, Farshid Lashkari <[EMAIL PROTECTED]> wrote:
Hi,

Should it be possible to change the osg::Shader of an osg::Program at
runtime? When I try this the shader doesn't change. I use the
following code to change the shader:

program->removeShader(oldShader);
program->addShader(newShader);

The osg::INFO log will print out the source of the new shader and that
it is relinking the program, and I get no errors. But the old shader
is still being applied when the geometry is drawn. Am I doing
something wrong?

Thanks,

Farshid
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to