1
0
Fork 0

Enable light source for transparent surfaces

This commit is contained in:
Frederic Bouvier 2012-04-01 23:37:47 +02:00
parent e46357d819
commit 25e0ab0b82

View file

@ -1457,8 +1457,7 @@ FGRenderer::setupView( void )
lightSource->setReferenceFrame(osg::LightSource::RELATIVE_RF);
lightSource->setLocalStateSetModes(osg::StateAttribute::ON);
lightSource->setUpdateCallback(new FGLightSourceUpdateCallback);
if ( _classicalRenderer )
mRealRoot->addChild(lightSource);
mRealRoot->addChild(lightSource);
// we need a white diffuse light for the phase of the moon
osg::LightSource* sunLight = new osg::LightSource;
sunLight->getLight()->setDataVariance(Object::DYNAMIC);
@ -1475,8 +1474,7 @@ FGRenderer::setupView( void )
skyGroup->addChild(_sky->getPreRoot());
sunLight->addChild(skyGroup);
mRoot->addChild(sceneGroup);
if ( _classicalRenderer )
mRoot->addChild(sunLight);
mRoot->addChild(sunLight);
// Clouds are added to the scene graph later
stateSet = globals->get_scenery()->get_scene_graph()->getOrCreateStateSet();