1
0
Fork 0

Attach an empty shader program to the scene graph root

This establishes a default state of using the OpenGL fixed function pipeline.
Otherwise a shader program from a state set can leak into state sets that don't
use shaders at all.
This commit is contained in:
Tim Moore 2009-11-12 10:58:42 +01:00
parent 9a94b26609
commit 6acd657a05

View file

@ -47,6 +47,7 @@
#include <osg/Notify>
#include <osg/PolygonMode>
#include <osg/PolygonOffset>
#include <osg/Program>
#include <osg/Version>
#include <osg/TexEnv>
@ -552,6 +553,10 @@ FGRenderer::init( void )
// as the rest of the scene. This may not be true in practice.
mRealRoot->addChild(thesky->getCloudRoot());
mRealRoot->addChild(FGCreateRedoutNode());
// Attach empty program to the scene root so that shader programs
// don't leak into state sets (effects) that shouldn't have one.
stateSet = mRealRoot->getOrCreateStateSet();
stateSet->setAttributeAndModes(new osg::Program, osg::StateAttribute::ON);
}