diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index def492c2038e27a3409dddf2ef5980b58e66a73f..cfca2d0d78c10b1261fcb63f2d8dc232d412d2b1 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -953,21 +953,8 @@ void LLSettingsSky::updateSettings()
 
 F32 LLSettingsSky::getSunMoonGlowFactor() const
 {
-    // sun glow at full iff moon is not up
-    if (getIsSunUp())
-    {
-        if (!getIsMoonUp())
-        {
-            return 1.0f;
-        }
-    }
-
-    if (getIsMoonUp())
-    {
-        return 0.25f;
-    }
-
-    return 0.0f;
+    return getIsSunUp()  ? 1.0f  :
+           getIsMoonUp() ? getMoonBrightness() * 0.25 : 0.0f;
 }
 
 bool LLSettingsSky::getIsSunUp() const
@@ -1302,7 +1289,7 @@ void LLSettingsSky::calculateLightSettings() const
 
     mMoonDiffuse  = gammaCorrect(componentMult(moonlight, light_transmittance) * moon_brightness);
     mMoonAmbient  = gammaCorrect(componentMult(moonlight_b, light_transmittance) * 0.0125f);
-    mTotalAmbient = mSunAmbient + mMoonAmbient;
+    mTotalAmbient = mSunAmbient;
 }
 
 LLUUID LLSettingsSky::GetDefaultAssetId()
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index f1eb1af90c55726412c9c2a398a71b54f6b1ffd0..aed5a9b950ed1c99378699dab87ac21b0c40d65e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -99,7 +99,8 @@ void main()
 	vec4 temp2 = vec4(0.);
 	vec4 blue_weight;
 	vec4 haze_weight;
-	vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
+	//vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
+	vec4 sunlight = sunlight_color;
 	vec4 light_atten;
 
     float dens_mul = density_multiplier * 0.45;
@@ -156,8 +157,6 @@ void main()
 			 );	
 
 	// CLOUDS
-
-	sunlight = sunlight_color;
 	temp2.y = max(0., lightnorm.y * 2.);
 	temp2.y = 1. / temp2.y;
 	sunlight *= exp( - light_atten * temp2.y);
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index aaf995af3c9420f8972384b50a24fce7b22997af..5c29290e47798e423e456ce5ac2ce438c685e8c1 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -101,7 +101,8 @@ void main()
     vec4 temp2 = vec4(0.);
     vec4 blue_weight;
     vec4 haze_weight;
-    vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
+    //vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
+    vec4 sunlight = sunlight_color;
     vec4 light_atten;
 
     float dens_mul = density_multiplier;