summaryrefslogtreecommitdiff
path: root/indra/newview/llenvironment.cpp
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-05-23 14:47:48 -0500
committerRunitaiLinden <davep@lindenlab.com>2023-05-23 14:47:48 -0500
commit095c624d0174b9e6cb54457e32e7588a828a4957 (patch)
tree44cdd19c77ef26b3590921ff6833b1c3bddbb5e5 /indra/newview/llenvironment.cpp
parenta9746a36a6121e4b585bc23757f7977045d68749 (diff)
SL-19745 Fix for resetting reflection probes when reapplying the same sky setting.
Diffstat (limited to 'indra/newview/llenvironment.cpp')
-rw-r--r--indra/newview/llenvironment.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index b14fbefeb9..aec7ceaa3c 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -1179,13 +1179,14 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm
return;
}
- DayInstance::ptr_t environment = getEnvironmentInstance(env, true);
+ bool reset_probes = false;
+ DayInstance::ptr_t environment = getEnvironmentInstance(env, true);
if (fixed.first)
{
logEnvironment(env, fixed.first, env_version);
- environment->setSky(fixed.first);
+ reset_probes = environment->setSky(fixed.first);
environment->setFlags(DayInstance::NO_ANIMATE_SKY);
}
else if (!environment->getSky())
@@ -1196,7 +1197,7 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm
// and then add water/sky on top
// This looks like it will result in sky using single keyframe instead of whole day if day is present
// when setting static water without static sky
- environment->setSky(mCurrentEnvironment->getSky());
+ reset_probes = environment->setSky(mCurrentEnvironment->getSky());
environment->setFlags(DayInstance::NO_ANIMATE_SKY);
}
else
@@ -1214,7 +1215,7 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm
if (substitute && substitute->getSky())
{
- environment->setSky(substitute->getSky());
+ reset_probes = environment->setSky(substitute->getSky());
environment->setFlags(DayInstance::NO_ANIMATE_SKY);
}
else
@@ -1266,7 +1267,10 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm
}
}
- gPipeline.mReflectionMapManager.reset();
+ if (reset_probes)
+ { // the sky changed in a way that merits a reset of reflection probes
+ gPipeline.mReflectionMapManager.reset();
+ }
if (!mSignalEnvChanged.empty())
mSignalEnvChanged(env, env_version);
@@ -2788,10 +2792,12 @@ void LLEnvironment::DayInstance::setDay(const LLSettingsDay::ptr_t &pday, LLSett
}
-void LLEnvironment::DayInstance::setSky(const LLSettingsSky::ptr_t &psky)
+bool LLEnvironment::DayInstance::setSky(const LLSettingsSky::ptr_t &psky)
{
mInitialized = false;
+ bool changed = psky == nullptr || mSky == nullptr || mSky->getHash() != psky->getHash();
+
bool different_sky = mSky != psky;
mSky = psky;
@@ -2805,6 +2811,8 @@ void LLEnvironment::DayInstance::setSky(const LLSettingsSky::ptr_t &psky)
LLEnvironment::getAtmosphericModelSettings(settings, psky);
gAtmosphere->configureAtmosphericModel(settings);
}
+
+ return changed;
}
void LLEnvironment::DayInstance::setWater(const LLSettingsWater::ptr_t &pwater)