camera = info->getCamera( GEOMETRY_CAMERA );
if (camera == 0) continue;
camera->setCullMask( nm & ~simgear::MODELLIGHT_BIT );
+
+ camera = info->getCamera( LIGHTING_CAMERA );
+ if (camera == 0) continue;
+ osg::Switch* sw = camera->getChild(0)->asSwitch();
+ for (unsigned int i = 0; i < sw->getNumChildren(); ++i) {
+ osg::Camera* lc = sw->getChild(i)->asCamera();
+ if (lc == 0) continue;
+ string name = lc->getName();
+ if (name == "LightCamera") {
+ lc->setCullMask( (nm & simgear::LIGHTS_BITS) | (lc->getCullMask() & ~simgear::LIGHTS_BITS) );
+ }
+ }
}
}
}
lightCam->setViewMatrix(osg::Matrix::identity());
lightCam->setProjectionMatrix(osg::Matrix::identity());
lightCam->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
- lightCam->setCullMask( simgear::MODELLIGHT_BIT | simgear::LIGHTS_BITS | simgear::PANEL2D_BIT );
+ lightCam->setCullMask( simgear::MODELLIGHT_BIT | simgear::PANEL2D_BIT );
lightCam->setInheritanceMask( osg::CullSettings::ALL_VARIABLES & ~osg::CullSettings::CULL_MASK );
lightCam->addChild( mDeferredRealRoot.get() );