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:
parent
9a94b26609
commit
6acd657a05
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue