summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llenvironment.cpp15
-rw-r--r--indra/newview/llreflectionmapmanager.cpp17
-rw-r--r--indra/newview/llreflectionmapmanager.h9
3 files changed, 39 insertions, 2 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index f672d2a6f1..edc7bdef5f 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -2954,12 +2954,20 @@ void LLEnvironment::DayTransition::animate()
setWater(mNextInstance->getWater());
});
+
+ // pause probe updates and reset reflection maps on sky change
+ gPipeline.mReflectionMapManager.pause();
+ gPipeline.mReflectionMapManager.reset();
+
mSky = mStartSky->buildClone();
mBlenderSky = std::make_shared<LLSettingsBlenderTimeDelta>(mSky, mStartSky, mNextInstance->getSky(), mTransitionTime);
mBlenderSky->setOnFinished(
[this](LLSettingsBlender::ptr_t blender) {
mBlenderSky.reset();
+ // resume reflection probe updates
+ gPipeline.mReflectionMapManager.resume();
+
if (!mBlenderSky && !mBlenderWater)
LLEnvironment::instance().mCurrentEnvironment = mNextInstance;
else
@@ -3550,12 +3558,19 @@ namespace
LLSettingsSky::ptr_t target_sky(start_sky->buildClone());
mInjectedSky->setSource(target_sky);
+ // clear reflection probes and pause updates during sky change
+ gPipeline.mReflectionMapManager.pause();
+ gPipeline.mReflectionMapManager.reset();
+
mBlenderSky = std::make_shared<LLSettingsBlenderTimeDelta>(target_sky, start_sky, psky, transition);
mBlenderSky->setOnFinished(
[this, psky](LLSettingsBlender::ptr_t blender)
{
mBlenderSky.reset();
mInjectedSky->setSource(psky);
+
+ // resume updating reflection probes when done animating sky
+ gPipeline.mReflectionMapManager.resume();
setSky(mInjectedSky);
if (!mBlenderWater && (countExperiencesActive() == 0))
{
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index bb0bb04797..915c8893a4 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -244,11 +244,14 @@ void LLReflectionMapManager::update()
continue;
}
- if (probe != mDefaultProbe && !probe->isRelevant())
- {
+ if (probe != mDefaultProbe &&
+ (!probe->isRelevant() || mPaused))
+ { // skip irrelevant probes (or all non-default probes if paused)
continue;
}
+
+
LLVector4a d;
if (probe != mDefaultProbe)
@@ -807,6 +810,16 @@ void LLReflectionMapManager::reset()
mReset = true;
}
+void LLReflectionMapManager::pause()
+{
+ mPaused = true;
+}
+
+void LLReflectionMapManager::resume()
+{
+ mPaused = false;
+}
+
void LLReflectionMapManager::shift(const LLVector4a& offset)
{
for (auto& probe : mProbes)
diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h
index 5a3901cae9..b77a33da89 100644
--- a/indra/newview/llreflectionmapmanager.h
+++ b/indra/newview/llreflectionmapmanager.h
@@ -84,6 +84,12 @@ public:
// reset all state on the next update
void reset();
+ // pause all updates other than the default probe
+ void pause();
+
+ // unpause (see pause)
+ void resume();
+
// called on region crossing to "shift" probes into new coordinate frame
void shift(const LLVector4a& offset);
@@ -191,5 +197,8 @@ private:
// if true, reset all probe render state on the next update (for teleports and sky changes)
bool mReset = false;
+
+ // if true, only update the default probe
+ bool mPaused = false;
};