diff options
author | Dave Parks <davep@lindenlab.com> | 2023-02-03 11:34:11 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-02-03 11:34:11 -0600 |
commit | 4259ea79535e88ef6d8ec8415c53c28d0c2d89ac (patch) | |
tree | e8df9036fa26eba61c3190925fb2512f63147d39 | |
parent | 1962f0b3b1d140a64bdc0ed77119f859d1d02a8e (diff) |
SL-19150 Fix for stuttering real-time reflection probes.
-rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llreflectionmapmanager.h | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index e622f54756..4fd10b85ad 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -206,11 +206,21 @@ void LLReflectionMapManager::update() { LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("rmmu - realtime"); // update the closest dynamic probe realtime + // should do a full irradiance pass on "odd" frames and a radiance pass on "even" frames closestDynamic->autoAdjustOrigin(); + + // store and override the value of "isRadiancePass" -- parts of the render pipe rely on "isRadiancePass" to set + // lighting values etc + bool radiance_pass = isRadiancePass(); + mRadiancePass = mRealtimeRadiancePass; for (U32 i = 0; i < 6; ++i) { updateProbeFace(closestDynamic, i); } + mRealtimeRadiancePass = !mRealtimeRadiancePass; + + // restore "isRadiancePass" + mRadiancePass = radiance_pass; } // switch to updating the next oldest probe diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 5936b26b88..85f428d75b 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -169,6 +169,11 @@ private: // This should avoid feedback loops and ensure that the colors in the radiance maps match the colors in the environment. bool mRadiancePass = false; + // same as above, but for the realtime probe. + // Realtime probes should update all six sides of the irradiance map on "odd" frames and all six sides of the + // radiance map on "even" frames. + bool mRealtimeRadiancePass = false; + LLPointer<LLReflectionMap> mDefaultProbe; // default reflection probe to fall back to for pixels with no probe influences (should always be at cube index 0) // number of reflection probes to use for rendering (based on saved setting RenderReflectionProbeCount) |