From 4711241dd523e64b68ef51e2b9e52a95b04e7034 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Fri, 16 Dec 2022 13:57:31 -0600
Subject: [PATCH] SL-18731 Fix for runaway feedback loops on reflection probe
 ambiance

---
 indra/newview/llreflectionmapmanager.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 1472abcec2e..d9d63416178 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -696,6 +696,7 @@ void LLReflectionMapManager::updateUniforms()
     LLSettingsSky::ptr_t psky = environment.getCurrentSky();
 
     F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance();
+    F32 ambscale = gCubeSnapshot ? 0.5f : 1.f;
 
     for (auto* refmap : mReflectionMaps)
     {
@@ -729,7 +730,7 @@ void LLReflectionMapManager::updateUniforms()
             rpd.refIndex[count][3] = -rpd.refIndex[count][3];
         }
 
-        rpd.refParams[count].set(llmax(minimum_ambiance, refmap->getAmbiance()), 0.f, 0.f, 0.f);
+        rpd.refParams[count].set(llmax(minimum_ambiance, refmap->getAmbiance())*ambscale, 0.f, 0.f, 0.f);
 
         S32 ni = nc; // neighbor ("index") - index into refNeighbor to write indices for current reflection probe's neighbors
         {
-- 
GitLab