Hi, I want to disable specific lights with OSG, and it affects models with shaders. How can I do it?
What I have now, it is not working. I apply shaders with: osg::StateSet* stateset = new osg::StateSet; [...load shader...] stateset->setAttributeAndModes(programObject, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); m_pDrawable->setStateSet(stateset); In execution, I wanto to disable some lights, and this change has to affect shader (in the shader I have two lights). But, when I disable light in OSG, it doesn't work. I have tested with and no succes: ss->setMode(GL_LIGHTING, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF); ss->setMode(GL_LIGHTING, osg::StateAttribute::PROTECTED | osg::StateAttribute::OFF); model->GetNode()->getOrCreateStateSet()->setMode(GL_LIGHT1, osg::StateAttribute::OFF); If I test with "normal" models (without shaders), it works. But the problem is with shaders. Do I have to turn off light in OpenGL? Thank you! ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59711#59711 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org