From eff14788a7378ea48659e3bdf1be4ddc5dd4e717 Mon Sep 17 00:00:00 2001 From: frohlich Date: Sat, 6 Jan 2007 15:09:42 +0000 Subject: [PATCH] Modified Files: src/Main/renderer.cxx: Don't try to render the moon without light... --- src/Main/renderer.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index 97ff85c7e..9d0581acf 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -434,7 +434,6 @@ FGRenderer::init( void ) { mBackGroundCamera->getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); - mRoot->addChild(mBackGroundCamera.get()); mSceneCamera->setClearMask(GL_DEPTH_BUFFER_BIT); inheritanceMask = osg::CullSettings::ALL_VARIABLES; @@ -444,7 +443,8 @@ FGRenderer::init( void ) { mSceneCamera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); mSceneCamera->setCullingMode(osg::CullSettings::DEFAULT_CULLING); mSceneCamera->setRenderOrder(osg::CameraNode::NESTED_RENDER); - mRoot->addChild(mSceneCamera.get()); + mSceneCamera->addChild(globals->get_scenery()->get_scene_graph()); + mSceneCamera->addChild(thesky->getCloudRoot()); stateSet = mSceneCamera->getOrCreateStateSet(); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); @@ -456,10 +456,11 @@ FGRenderer::init( void ) { // relative because of CameraView being just a clever transform node lightSource->setReferenceFrame(osg::LightSource::RELATIVE_RF); lightSource->setLocalStateSetModes(osg::StateAttribute::ON); - mSceneCamera->addChild(lightSource); + mRoot->addChild(lightSource); + + lightSource->addChild(mBackGroundCamera.get()); + lightSource->addChild(mSceneCamera.get()); - lightSource->addChild(globals->get_scenery()->get_scene_graph()); - lightSource->addChild(thesky->getCloudRoot()); stateSet = globals->get_scenery()->get_scene_graph()->getOrCreateStateSet(); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON);