1
0
Fork 0

Modified Files:

src/Main/renderer.cxx: Don't try to render the moon without light...
This commit is contained in:
frohlich 2007-01-06 15:09:42 +00:00
parent b656148e29
commit eff14788a7

View file

@ -434,7 +434,6 @@ FGRenderer::init( void ) {
mBackGroundCamera->getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); mBackGroundCamera->getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
mRoot->addChild(mBackGroundCamera.get());
mSceneCamera->setClearMask(GL_DEPTH_BUFFER_BIT); mSceneCamera->setClearMask(GL_DEPTH_BUFFER_BIT);
inheritanceMask = osg::CullSettings::ALL_VARIABLES; inheritanceMask = osg::CullSettings::ALL_VARIABLES;
@ -444,7 +443,8 @@ FGRenderer::init( void ) {
mSceneCamera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); mSceneCamera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
mSceneCamera->setCullingMode(osg::CullSettings::DEFAULT_CULLING); mSceneCamera->setCullingMode(osg::CullSettings::DEFAULT_CULLING);
mSceneCamera->setRenderOrder(osg::CameraNode::NESTED_RENDER); 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 = mSceneCamera->getOrCreateStateSet();
stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON);
@ -456,10 +456,11 @@ FGRenderer::init( void ) {
// relative because of CameraView being just a clever transform node // relative because of CameraView being just a clever transform node
lightSource->setReferenceFrame(osg::LightSource::RELATIVE_RF); lightSource->setReferenceFrame(osg::LightSource::RELATIVE_RF);
lightSource->setLocalStateSetModes(osg::StateAttribute::ON); 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 = globals->get_scenery()->get_scene_graph()->getOrCreateStateSet();
stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON);