diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2024-02-15 09:38:29 -0800 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2024-02-15 09:38:29 -0800 |
commit | 7a9cdf2b52ca95c8e269e2bb4ed01379b76434d6 (patch) | |
tree | b2a302930282374182d4f0916d225d1486f94c64 | |
parent | a5a2254b6fdc2fb1573135a4ffdf37e08dc9752f (diff) |
#682 Do conservative updates on probes.
-rw-r--r-- | indra/newview/llheroprobemanager.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llheroprobemanager.h | 1 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 9 |
3 files changed, 28 insertions, 4 deletions
diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 2a81919856..1f050a5166 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -155,6 +155,25 @@ void LLHeroProbeManager::update() probe_pos.load3(point.mV); + + // Collect the list of faces that need updating based upon the camera's rotation. + LLVector3 cam_direction = LLVector3(0, 0, -1) * LLViewerCamera::instance().getQuaternion(); + + static LLVector3 cubeFaces[6] = { + LLVector3(1, 0, 0), + LLVector3(-1, 0, 0), + LLVector3(0, 1, 0), + LLVector3(0, -1, 0), + LLVector3(0, 0, 1), + LLVector3(0, 0, -1) + }; + + for (int i = 0; i < 6; i++) + { + bool shouldUpdate = (cam_direction * cubeFaces[i]) > 0; + + mFaceUpdateList[i] = shouldUpdate; + } } else { @@ -185,7 +204,8 @@ void LLHeroProbeManager::update() { for (U32 i = 0; i < 6; ++i) { - updateProbeFace(mProbes[j], i, near_clip); + if (mFaceUpdateList[i]) + updateProbeFace(mProbes[j], i, near_clip); } } mRenderingMirror = false; diff --git a/indra/newview/llheroprobemanager.h b/indra/newview/llheroprobemanager.h index 552c5dcaab..d2a319c500 100644 --- a/indra/newview/llheroprobemanager.h +++ b/indra/newview/llheroprobemanager.h @@ -134,6 +134,7 @@ private: bool mReset = false; bool mRenderingMirror = false; + std::map<int, bool> mFaceUpdateList; std::set<LLPointer<LLVOVolume>> mHeroVOList; LLPointer<LLVOVolume> mNearestHero; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9d90002eb9..180204b0ce 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -786,9 +786,12 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) U32 res = mReflectionMapManager.mProbeResolution * 4; //multiply by 4 because probes will be 16x super sampled allocateScreenBuffer(res, res, samples); - res = mHeroProbeManager.mProbeResolution; // We also scale the hero probe RT to the probe res since we don't super sample it. - mRT = &mHeroProbeRT; - allocateScreenBuffer(res, res, samples); + if (RenderMirrors) + { + res = mHeroProbeManager.mProbeResolution; // We also scale the hero probe RT to the probe res since we don't super sample it. + mRT = &mHeroProbeRT; + allocateScreenBuffer(res, res, samples); + } mRT = &mMainRT; gCubeSnapshot = FALSE; |