summaryrefslogtreecommitdiff
path: root/indra/newview/llvosky.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-08-12 14:25:35 -0700
committerGraham Linden <graham@lindenlab.com>2019-08-12 14:25:35 -0700
commit5937a4222473131d0cec4238fc234646e9aba91e (patch)
tree8abbf7f5c47ed744da42fad293dd09234538e7c2 /indra/newview/llvosky.cpp
parent41c7523e08aab7f2bf4a040ac1c1c8a1d24babed (diff)
SL-10566, SL-10677
Make sky updates only occur if the input atmospherics values have actually changed (perf optimization). Make water rendering use specular color for coloring spec.
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r--indra/newview/llvosky.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 8d5c0f04cd..78c782eb5f 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -479,7 +479,7 @@ void LLVOSky::init()
m_atmosphericsVars.density_multiplier = psky->getDensityMultiplier();
m_atmosphericsVars.max_y = psky->getMaxY();
m_atmosphericsVars.sun_norm = LLEnvironment::instance().getClampedSunNorm();
- m_atmosphericsVars.sunlight = psky->getSunlightColor();
+ m_atmosphericsVars.sunlight = psky->getIsSunUp() ? psky->getSunlightColor() : psky->getMoonlightColor();
m_atmosphericsVars.ambient = psky->getAmbientColor();
m_atmosphericsVars.glow = psky->getGlow();
m_atmosphericsVars.cloud_shadow = psky->getCloudShadow();
@@ -531,7 +531,7 @@ void LLVOSky::calc()
m_atmosphericsVars.distance_multiplier = psky->getDistanceMultiplier();
m_atmosphericsVars.max_y = psky->getMaxY();
m_atmosphericsVars.sun_norm = LLEnvironment::instance().getClampedSunNorm();
- m_atmosphericsVars.sunlight = psky->getSunlightColor();
+ m_atmosphericsVars.sunlight = psky->getIsSunUp() ? psky->getSunlightColor() : psky->getMoonlightColor();
m_atmosphericsVars.ambient = psky->getAmbientColor();
m_atmosphericsVars.glow = psky->getGlow();
m_atmosphericsVars.cloud_shadow = psky->getCloudShadow();
@@ -750,7 +750,9 @@ bool LLVOSky::updateSky()
calc();
- if (mForceUpdate && mForceUpdateThrottle.hasExpired())
+ bool same_atmospherics = m_lastAtmosphericsVars == m_atmosphericsVars;
+
+ if (mForceUpdate && mForceUpdateThrottle.hasExpired() && !same_atmospherics)
{
LL_RECORD_BLOCK_TIME(FTM_VOSKY_UPDATEFORCED);
@@ -758,6 +760,8 @@ bool LLVOSky::updateSky()
LLSkyTex::stepCurrent();
+ m_lastAtmosphericsVars = m_atmosphericsVars;
+
if (!direction.isExactlyZero())
{
mLastTotalAmbient = total_ambient;