From 8acb87aaf32e6f27d2f8caba6178cdd7a80c2086 Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Thu, 4 Oct 2018 17:00:07 +0300
Subject: [PATCH] SL-9809 [EEP] Environment becomes dark after setting "Glow
 Size" to the maximum value

---
 indra/newview/lllegacyatmospherics.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/indra/newview/lllegacyatmospherics.cpp b/indra/newview/lllegacyatmospherics.cpp
index 04623c44521..0c4e5b48e8c 100644
--- a/indra/newview/lllegacyatmospherics.cpp
+++ b/indra/newview/lllegacyatmospherics.cpp
@@ -333,8 +333,17 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars)
 		// temp2.x is 0 at the sun and increases away from sun
 	temp2.mV[0] = llmax(temp2.mV[0], .001f);	
 		// Set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
-	temp2.mV[0] *= glow.mV[0];
+
+	if (glow.mV[0] > 0) // don't pow(zero,negative value), glow from 0 to 2
+	{
 		// Higher glow.x gives dimmer glow (because next step is 1 / "angle")
+		temp2.mV[0] *= glow.mV[0];
+	}
+	else
+	{
+		temp2.mV[0] = F32_MIN;
+	}
+
 	temp2.mV[0] = pow(temp2.mV[0], glow.mV[2]);
 		// glow.z should be negative, so we're doing a sort of (1 / "angle") function
 
-- 
GitLab