Hi
The thing is osg::StateAttributes can not be turned ON or OFF with flags like that, if you have attribute in stateset it always ON (if you look at source, StateSet even dont save ON-OFF flags for state attributes, only PROTECTED and OVERRIDE bits). You can control if they have any effect with gl modes through StateSet::setMode(...) interface, but there are no such mode for program. To disable osg::Program you can set empty osg::Program on state set in question, like:
stateset->setAttribute(new osg::Program, osg::StateAttribute::PROTECTED);
stateset->setAttribute(new osg::Program, osg::StateAttribute::PROTECTED);
Cheers,
Sergey.
13.02.2013, 18:20, "Frank Kane" <[email protected]>:
Hi gang,,I've got a setup where I have an osg::Program attached near the top of my scene graph to do lighting effects. It works great, except that LightPointNodes don't show up when it's active.I tried intercepting the LightPointNodes in the graph inside a cull visitor, and disabling the shader on it - roughly like this:osg::ref_ptr<osg::StateSet> ss = lightPointNode.getStateSet();if (ss && ss.valid()) {ss->setAttributeAndModes(myProgram.get(), osg::StateAttribute::OFF);}But, this seems to have no effect (I checked - the call to setAttributeAndModes is being reached). Looking at the osgSim::LightPointNode source, it looks like it's doing tricks with a singleton state set shared amongst them all, its own render bin, and manipulating its own state set graph. I don't know if that's wiping out my state somehow, or if I'm just Doing It Wrong.Has anyone else ever encountered trouble using shaders in conjuction with LightPointNodes? Any advice if so?Thanks!FrankFrank Kane
Founder
Sundog Software, LLC
http://www.sundog-soft.com/
http://www.linkedin.com/pub/frank-kane/17/434/764_______________________________________________
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

