From 36949692b63031f70451317445a1a368efbfcaff Mon Sep 17 00:00:00 2001
From: RunitaiLinden <davep@lindenlab.com>
Date: Wed, 28 Jun 2023 11:00:10 -0500
Subject: [PATCH] SL-19842 Nudge dynamic exposure coefficient and soften
 indirect lighting.

---
 indra/newview/app_settings/settings.xml              |  2 +-
 .../shaders/class3/deferred/reflectionProbeF.glsl    | 12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index f3065d12b83..09eda2534c6 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -10643,7 +10643,7 @@
     <key>Type</key>
     <string>F32</string>
     <key>Value</key>
-    <real>0.4</real>
+    <real>0.5</real>
   </map>
     <key>RenderShaderLODThreshold</key>
     <map>
diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
index 1b2a34ef015..41821def8e8 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
@@ -364,7 +364,8 @@ return texCUBE(envMap, ReflDirectionWS);
 // dir - ray direction in clip space
 // i - probe index in refBox/refSphere
 // d - distance to nearest wall in clip space
-vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d)
+// scale - scale of box, default 1.0
+vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d, float scale)
 {
     // Intersection with OBB convert to unit box space
     // Transform in local unit parallax cube space (scaled and rotated)
@@ -375,7 +376,7 @@ vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d)
 
     d = 1.0-max(max(abs(PositionLS.x), abs(PositionLS.y)), abs(PositionLS.z));
 
-    vec3 Unitary = vec3(1.0f, 1.0f, 1.0f);
+    vec3 Unitary = vec3(scale);
     vec3 FirstPlaneIntersect  = (Unitary - PositionLS) / RayLS;
     vec3 SecondPlaneIntersect = (-Unitary - PositionLS) / RayLS;
     vec3 FurthestPlane = max(FirstPlaneIntersect, SecondPlaneIntersect);
@@ -387,6 +388,11 @@ vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d)
     return IntersectPositionCS;
 }
 
+vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d)
+{
+    return boxIntersect(origin, dir, i, d, 1.0);
+}
+
 void debugBoxCol(vec3 ro, vec3 rd, float t, vec3 p, inout vec4 col)
 {
     vec3 v = ro + rd * t;
@@ -531,7 +537,7 @@ vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int
     if (refIndex[i].w < 0)
     {
         float d = 0.0;
-        v = boxIntersect(pos, dir, i, d);
+        v = boxIntersect(pos, dir, i, d, 3.0);
         w = max(d, 0.001);
     }
     else
-- 
GitLab