diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-05-23 14:47:48 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-05-23 14:47:48 -0500 |
commit | 095c624d0174b9e6cb54457e32e7588a828a4957 (patch) | |
tree | 44cdd19c77ef26b3590921ff6833b1c3bddbb5e5 /indra | |
parent | a9746a36a6121e4b585bc23757f7977045d68749 (diff) |
SL-19745 Fix for resetting reflection probes when reapplying the same sky setting.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llenvironment.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llenvironment.h | 2 |
2 files changed, 15 insertions, 7 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) diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 4383f54f25..82bfc4ec51 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -264,7 +264,7 @@ public: virtual bool applyTimeDelta(const LLSettingsBase::Seconds& delta); virtual void setDay(const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); - virtual void setSky(const LLSettingsSky::ptr_t &psky); + bool setSky(const LLSettingsSky::ptr_t &psky); virtual void setWater(const LLSettingsWater::ptr_t &pwater); void initialize(); |