summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2021-10-21 18:43:35 -0700
committerPtolemy <ptolemy@lindenlab.com>2021-10-21 18:43:35 -0700
commitde2c6826073ab1fbc83ac8a486157c177aa1f5dc (patch)
tree044756b62cefb27d75dcbb5b997e3c72b1ad7b2f
parent94d08a13d5737f072231584d9f135dc44e8c6750 (diff)
SL-16127: Fix bug in int() not calling getDistanceMultiplier(), calc() not calling getTotalDensity()
-rw-r--r--indra/newview/llvosky.cpp62
-rw-r--r--indra/newview/llvosky.h1
2 files changed, 26 insertions, 37 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 1fd10a231a..882bfe6f7d 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -466,24 +466,7 @@ void LLVOSky::init()
updateDirections(psky);
- // invariants across whole sky tex process...
- m_atmosphericsVars.blue_density = psky->getBlueDensity();
- m_atmosphericsVars.blue_horizon = psky->getBlueHorizon();
- m_atmosphericsVars.haze_density = psky->getHazeDensity();
- m_atmosphericsVars.haze_horizon = psky->getHazeHorizon();
- m_atmosphericsVars.density_multiplier = psky->getDensityMultiplier();
- m_atmosphericsVars.max_y = psky->getMaxY();
- m_atmosphericsVars.sun_norm = LLEnvironment::instance().getClampedSunNorm();
- 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();
- m_atmosphericsVars.dome_radius = psky->getDomeRadius();
- m_atmosphericsVars.dome_offset = psky->getDomeOffset();
- m_atmosphericsVars.light_atten = psky->getLightAttenuation(m_atmosphericsVars.max_y);
- m_atmosphericsVars.light_transmittance = psky->getLightTransmittance(m_atmosphericsVars.max_y);
- m_atmosphericsVars.total_density = psky->getTotalDensity();
- m_atmosphericsVars.gamma = psky->getGamma();
+ cacheEnvironment(psky,m_atmosphericsVars);
// Initialize the cached normalized direction vectors
for (S32 side = 0; side < NUM_CUBEMAP_FACES; ++side)
@@ -508,28 +491,33 @@ void LLVOSky::init()
}
+void LLVOSky::cacheEnvironment(LLSettingsSky::ptr_t psky,AtmosphericsVars& atmosphericsVars)
+{
+ // invariants across whole sky tex process...
+ atmosphericsVars.blue_density = psky->getBlueDensity();
+ atmosphericsVars.blue_horizon = psky->getBlueHorizon();
+ atmosphericsVars.haze_density = psky->getHazeDensity();
+ atmosphericsVars.haze_horizon = psky->getHazeHorizon();
+ atmosphericsVars.density_multiplier = psky->getDensityMultiplier();
+ atmosphericsVars.distance_multiplier = psky->getDistanceMultiplier();
+ atmosphericsVars.max_y = psky->getMaxY();
+ atmosphericsVars.sun_norm = LLEnvironment::instance().getClampedSunNorm();
+ atmosphericsVars.sunlight = psky->getIsSunUp() ? psky->getSunlightColor() : psky->getMoonlightColor();
+ atmosphericsVars.ambient = psky->getAmbientColor();
+ atmosphericsVars.glow = psky->getGlow();
+ atmosphericsVars.cloud_shadow = psky->getCloudShadow();
+ atmosphericsVars.dome_radius = psky->getDomeRadius();
+ atmosphericsVars.dome_offset = psky->getDomeOffset();
+ atmosphericsVars.light_atten = psky->getLightAttenuation(atmosphericsVars.max_y);
+ atmosphericsVars.light_transmittance = psky->getLightTransmittance(atmosphericsVars.max_y);
+ atmosphericsVars.total_density = psky->getTotalDensity();
+ atmosphericsVars.gamma = psky->getGamma();
+}
+
void LLVOSky::calc()
{
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
-
- // invariants across whole sky tex process...
- m_atmosphericsVars.blue_density = psky->getBlueDensity();
- m_atmosphericsVars.blue_horizon = psky->getBlueHorizon();
- m_atmosphericsVars.haze_density = psky->getHazeDensity();
- m_atmosphericsVars.haze_horizon = psky->getHazeHorizon();
- m_atmosphericsVars.density_multiplier = psky->getDensityMultiplier();
- m_atmosphericsVars.distance_multiplier = psky->getDistanceMultiplier();
- m_atmosphericsVars.max_y = psky->getMaxY();
- m_atmosphericsVars.sun_norm = LLEnvironment::instance().getClampedSunNorm();
- 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();
- m_atmosphericsVars.dome_radius = psky->getDomeRadius();
- m_atmosphericsVars.dome_offset = psky->getDomeOffset();
- m_atmosphericsVars.light_atten = psky->getLightAttenuation(m_atmosphericsVars.max_y);
- m_atmosphericsVars.light_transmittance = psky->getLightTransmittance(m_atmosphericsVars.max_y);
- m_atmosphericsVars.gamma = psky->getGamma();
+ cacheEnvironment(psky,m_atmosphericsVars);
mSun.setColor(psky->getSunDiffuse());
mMoon.setColor(LLColor3(1.0f, 1.0f, 1.0f));
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h
index 0b313a9a61..793dcf4cbf 100644
--- a/indra/newview/llvosky.h
+++ b/indra/newview/llvosky.h
@@ -219,6 +219,7 @@ public:
void restoreGL();
void calc();
+ void cacheEnvironment(LLSettingsSky::ptr_t psky, AtmosphericsVars& atmosphericsVars);
/*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time);
bool updateSky();