]> git.mxchange.org Git - flightgear.git/commitdiff
Make the point light non permanent in Rembrandt
authorFrederic Bouvier <fredfgfs01@free.fr>
Sun, 15 Jul 2012 06:13:05 +0000 (08:13 +0200)
committerFrederic Bouvier <fredfgfs01@free.fr>
Sun, 15 Jul 2012 06:13:05 +0000 (08:13 +0200)
src/Viewer/CameraGroup.cxx
src/Viewer/renderer.cxx

index 020637db5351b7b89d254b490771ba86573fef6c..4cabb31812e4bdda7988cfb17e0bfe800117ef94 100644 (file)
@@ -1087,6 +1087,18 @@ void CameraGroup::setCameraCullMasks(Node::NodeMask nm)
             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) );
+                }
+            }
         }
     }
 }
index ffc6c21eb5a3cc42d8cdaeaf8ae14f0a64c819dc..9d64ddc523495987283918507799751b1ae4ce61 100644 (file)
@@ -1275,7 +1275,7 @@ FGRenderer::buildLightingLightsPass(CameraInfo* info, FGRenderingPipeline::Pass*
     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() );