From 9dee4149ae6f33e2f82b8986b041df311f0cbe88 Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Tue, 26 Mar 2019 13:37:07 -0700
Subject: [PATCH] Remove remaining 0.5/1.5 fudge factors on lighting
 radius/falloff params.

Make moonlight darker and slightly bluish for scotopic feel when moon is primary.
---
 indra/llinventory/llsettingssky.cpp | 5 +++--
 indra/newview/pipeline.cpp          | 8 ++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 0e597aabb0c..a7b87c4d969 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -1295,8 +1295,9 @@ void LLSettingsSky::calculateLightSettings() const
     mSunDiffuse = gammaCorrect(componentMult(sunlight, light_transmittance));
     mSunAmbient = gammaCorrect(componentMult(tmpAmbient, light_transmittance) * 0.5);
 
-    mMoonDiffuse  = gammaCorrect(componentMult(LLColor3::white, light_transmittance) * 0.5f);
-    mMoonAmbient  = gammaCorrect(componentMult(LLColor3::white, light_transmittance) * 0.25f);
+    LLColor3 moonlight(0.75, 0.75, 0.92);
+    mMoonDiffuse  = gammaCorrect(componentMult(moonlight, light_transmittance) * 0.25f);
+    mMoonAmbient  = gammaCorrect(componentMult(moonlight, light_transmittance) * 0.125f);
     mTotalAmbient = mSunAmbient;
 }
 
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 8bc68ac9eaf..658410fd3da 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -8703,7 +8703,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
                     LLVector4a center;
                     center.load3(drawablep->getPositionAgent().mV);
                     const F32* c = center.getF32ptr();
-                    F32 s = volume->getLightRadius()*1.5f;
+                    F32 s = volume->getLightRadius();
 
                     LLColor3 col = volume->getLightColor();
                     
@@ -8770,7 +8770,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
                         mat.mult_matrix_vec(tc);
                     
                         fullscreen_lights.push_back(LLVector4(tc.v[0], tc.v[1], tc.v[2], s));
-                        light_colors.push_back(LLVector4(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f));
+                        light_colors.push_back(LLVector4(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()));
                     }
                 }
                 unbindDeferredShader(gDeferredLightProgram);
@@ -8795,7 +8795,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
                     LLVector4a center;
                     center.load3(drawablep->getPositionAgent().mV);
                     const F32* c = center.getF32ptr();
-                    F32 s = volume->getLightRadius()*1.5f;
+                    F32 s = volume->getLightRadius();
 
                     sVisibleLightCount++;
 
@@ -8888,7 +8888,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
 
                     LLVector3 center = drawablep->getPositionAgent();
                     F32* c = center.mV;
-                    F32 s = volume->getLightRadius()*1.5f;
+                    F32 s = volume->getLightRadius();
 
                     sVisibleLightCount++;
 
-- 
GitLab