Browse Source

registergloballights now taks a (by default on) cullSceneLights. off for reflection capture as that is presently acting up

Azaezel 6 years ago
parent
commit
bd742bbf75

+ 12 - 11
Engine/source/lighting/lightManager.cpp

@@ -198,7 +198,7 @@ void LightManager::setSpecialLight( LightManager::SpecialLightTypesEnum type, Li
    registerGlobalLight( light, NULL );
 }
 
-void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLighting )
+void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLighting, bool cullSceneLights)
 {
    PROFILE_SCOPE( LightManager_RegisterGlobalLights );
 
@@ -226,16 +226,17 @@ void LightManager::registerGlobalLights( const Frustum *frustum, bool staticLigh
    {
       // Cull the lights using the frustum.
       getSceneManager()->getContainer()->findObjectList( *frustum, lightMask, &activeLights );
-
-      for (U32 i = 0; i < activeLights.size(); ++i)
-      {
-         if (!getSceneManager()->mRenderedObjectsList.contains(activeLights[i]))
-         {
-            activeLights.erase(i);
-            --i;
-         }
-      }
-
+	  if (cullSceneLights)
+	  {
+		  for (U32 i = 0; i < activeLights.size(); ++i)
+		  {
+			  if (!getSceneManager()->mRenderedObjectsList.contains(activeLights[i]))
+			  {
+				  activeLights.erase(i);
+				  --i;
+			  }
+		  }
+	  }
       // Store the culling position for sun placement
       // later... see setSpecialLight.
       mCullPos = frustum->getPosition();

+ 1 - 1
Engine/source/lighting/lightManager.h

@@ -134,7 +134,7 @@ public:
    virtual void registerLocalLight( LightInfo *light );
    virtual void unregisterLocalLight( LightInfo *light );
 
-   virtual void registerGlobalLights( const Frustum *frustum, bool staticlighting );
+   virtual void registerGlobalLights( const Frustum *frustum, bool staticlighting, bool cullSceneLights = true );
    virtual void unregisterAllLights();
 
    /// Returns all unsorted and un-scored lights (both global and local).

+ 1 - 1
Engine/source/scene/reflector.cpp

@@ -422,7 +422,7 @@ void CubeReflector::updateFace( const ReflectParams &params, U32 faceidx )
    reflectRenderState.setDiffuseCameraTransform( params.query->headMatrix );
 
    // render scene
-   LIGHTMGR->registerGlobalLights( &reflectRenderState.getCullingFrustum(), false );
+   LIGHTMGR->registerGlobalLights( &reflectRenderState.getCullingFrustum(), false, false );
    gClientSceneGraph->renderSceneNoLights( &reflectRenderState, mDesc->objectTypeMask );
    LIGHTMGR->unregisterAllLights();
 

+ 1 - 1
Engine/source/scene/sceneManager.cpp

@@ -195,7 +195,7 @@ void SceneManager::renderScene( SceneRenderState* renderState, U32 objectMask, S
    // Get the lights for rendering the scene.
 
    PROFILE_START( SceneGraph_registerLights );
-      LIGHTMGR->registerGlobalLights( &renderState->getCullingFrustum(), false );
+      LIGHTMGR->registerGlobalLights( &renderState->getCullingFrustum(), false, renderState->isDiffusePass());
    PROFILE_END();
 
    // If its a diffuse pass, update the current ambient light level.