summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingssky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llinventory/llsettingssky.cpp')
-rw-r--r--indra/llinventory/llsettingssky.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index cfca2d0d78..211af6a7ae 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -32,6 +32,10 @@
#include "llfasttimer.h"
#include "v3colorutil.h"
+#if LL_WINDOWS
+#pragma optimize("", off)
+#endif
+
//=========================================================================
namespace
{
@@ -1276,8 +1280,10 @@ void LLSettingsSky::calculateLightSettings() const
LLColor3 tmpAmbient = ambient + (smear(1.f) - ambient) * cloud_shadow;
//brightness of surface both sunlight and ambient
- mSunDiffuse = gammaCorrect(componentMult(sunlight, light_transmittance));
- mSunAmbient = gammaCorrect(componentMult(tmpAmbient, light_transmittance));
+ // reduce range to 0 - 1 before gamma correct to prevent clipping
+ // then restore to full 0 - 3 range before storage
+ mSunDiffuse = gammaCorrect(componentMult(sunlight * 0.33333f, light_transmittance)) * 3.0f;
+ mSunAmbient = gammaCorrect(componentMult(tmpAmbient * 0.33333f, light_transmittance)) * 3.0f;
F32 moon_brightness = getIsMoonUp() ? getMoonBrightness() : 0.001f;