You can also just add an empty program to the StateSet. Something like this:
ss->setAttributeAndModes(new osg::Program()); This will bind a program object which will call glUseProgram(0) on the next apply, which is in fact the same as disable a shader program. Cheers, art --- Robert Osfield <[EMAIL PROTECTED]> schrieb am Do, 28.8.2008: > Von: Robert Osfield <[EMAIL PROTECTED]> > Betreff: Re: [osg-users] Disable Shader > An: "OpenSceneGraph Users" <[email protected]> > Datum: Donnerstag, 28. August 2008, 10:57 > Hi Christian, > > Unfortunately you can disable GLSL programs (shaders), as > OpenGL > itself doesn't support glEnable/glDisable of GLSL > programs. If you > wish to toggle between the fixed function pipeline and > using a GLSL > program then you have to remove the Program i.e. > > ss->removeAttribute(m_program.get()); > > Robert. > > On Thu, Aug 28, 2008 at 9:31 AM, > <[EMAIL PROTECTED]> wrote: > > > > Hi! > > > > I have a short question about Shaders: How can I > disable a Shader? > > > > osg::StateSet* ss = m_pNode->getOrCreateStateSet(); > > ss->setAttributeAndModes(m_program.get(), > osg::StateAttribute::OFF); > > > > Does not work, even if I set it for the first time. > > Where is the trick? > > > > Thanks in advance, > > Christian > > > > _______________________________________________ > > osg-users mailing list > > [email protected] > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

