From: Tim Moore Date: Thu, 12 Nov 2009 09:58:42 +0000 (+0100) Subject: Attach an empty shader program to the scene graph root X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6acd657a05b8dfb5a4491de871fdbf51404bcfe5;p=flightgear.git 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. --- diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index ece25ec32..cfe5f29a3 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -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); }