[osg-users] force fixed function pipeline
Hi Robert and all I have a main shader for my scene graph. Then I have some parts of my loaded models that I want to explicitely render with the fixed-function-pipeline (FFP). In osg 3.1.5 I was able to modify a particular stateset by writing a_node.getOrCreateStateSet()->setAttributeAndModes(new osg::Program, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED); Like this, the main shader was ignored for the the node and underlying children and the FFP was used. I don't know why but in OSG 3.2.0 this doesn't work anymore. I tried with osg::StateAttribute::OFF/ON etc. I just cant switch back to FFP . 1. What is the reason this behaviour changed? 2. What is the correct way to bypass/disable a shader at some particular point in the scene-graph? Thanks for help! Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] force fixed function pipeline
HI Daniel, you can set an empty Program in the stateset instead of disabling it. This way the subgraph will be rendered using the fixed pipe-line. Like stateset->setAttributeAndModes( new osg::Program, on, override, whatever ) Nick On Fri, Feb 7, 2014 at 1:14 PM, Daniel Schmid wrote: > Hi Robert and all > > > > I have a main shader for my scene graph. Then I have some parts of my > loaded models that I want to explicitely render with the > fixed-function-pipeline (FFP). > > In osg 3.1.5 I was able to modify a particular stateset by writing > > > > a_node.getOrCreateStateSet()->setAttributeAndModes(new osg::Program, > osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED); > > > > Like this, the main shader was ignored for the the node and underlying > children and the FFP was used. > > > > I don't know why but in OSG 3.2.0 this doesn't work anymore. I tried with > osg::StateAttribute::OFF/ON etc. I just cant switch back to FFP . > > > > 1. What is the reason this behaviour changed? > > 2. What is the correct way to bypass/disable a shader at some > particular point in the scene-graph? > > > > Thanks for help! > > > > Daniel > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] force fixed function pipeline
I know setting an empty program is the way this used to be done. And it seemed to work for some time. But in my case it doens't. In the apply method of osg::Program, a call to glUseProgram(0) is issued when the program object is empty. According to http://stackoverflow.com/questions/13546461/what-does-gluseprogram0-do this is not a reliable way of falling back to FFP, and it seems to depend heavily on opengl profile and probably also on the driver... Are there any alternative solutions? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58183#58183 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] force fixed function pipeline
I chose the following solution: by knowing that binding program 0 (zero) doesn't give 100% correct results with all drivers, I created a fragment program that simply passes the incoming color to the output. Like this I was sure that at least the vertex part of the pipeline is using fixed function. That solved my problem and I always have predictable results. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58245#58245 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org