From 8c79297a8957fec13fadd2a2932b4b03b148d5a5 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Mon, 26 Feb 2024 01:21:41 -0800 Subject: #682 Further tweak the conservative update mechanism. --- indra/newview/app_settings/settings.xml | 13 ++++++++++++- indra/newview/llheroprobemanager.cpp | 7 ++++++- indra/newview/llheroprobemanager.h | 1 - indra/newview/pipeline.cpp | 3 +++ indra/newview/pipeline.h | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6a84f64030..e707e1eb5e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10399,7 +10399,18 @@ Type S32 Value - 1 + 2 + + RenderHeroProbeConservativeUpdateMultiplier + + Comment + How many probe updates to wait until it's time to update faces that are not directly facing the camera. Acts as a multiplier. E.g., frames to the periphery of the camera updating once every 3 updates, vs ones directly facing the camera updating every update. + Persist + 1 + Type + S32 + Value + 16 RenderReflectionProbeVolumes diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 3adf460432..a00b6d6b5d 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -165,7 +165,12 @@ void LLHeroProbeManager::update() { float shouldUpdate = cam_direction * cubeFaces[i] * 0.5 + 0.5; - int updateRate = fmaxf(1, (1 - shouldUpdate) * 8); + int updateRate = ceilf((1 - shouldUpdate) * gPipeline.RenderHeroProbeConservativeUpdateMultiplier); + + // Chances are this is a face that's non-visible to the camera when it's being reflected. + // Set it to 0. It will be skipped below. + if (updateRate == gPipeline.RenderHeroProbeConservativeUpdateMultiplier) + updateRate = 0; mFaceUpdateList[i] = updateRate; } diff --git a/indra/newview/llheroprobemanager.h b/indra/newview/llheroprobemanager.h index 038a8fd45a..e430cae203 100644 --- a/indra/newview/llheroprobemanager.h +++ b/indra/newview/llheroprobemanager.h @@ -138,7 +138,6 @@ private: std::map mFaceUpdateList; U32 mCurrentProbeUpdateFrame = 0; - U32 mLowPriorityFaceThrottle = 2; std::vector mHeroVOList; LLVOVolume* mNearestHero; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e3e2da3b30..94ec5c0817 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -200,6 +200,7 @@ S32 LLPipeline::RenderScreenSpaceReflectionGlossySamples; S32 LLPipeline::RenderBufferVisualization; bool LLPipeline::RenderMirrors; S32 LLPipeline::RenderHeroProbeUpdateRate; +S32 LLPipeline::RenderHeroProbeConservativeUpdateMultiplier; LLTrace::EventStatHandle LLPipeline::sStatBatchSize("renderbatchsize"); const U32 LLPipeline::MAX_BAKE_WIDTH = 512; @@ -561,6 +562,7 @@ void LLPipeline::init() connectRefreshCachedSettingsSafe("RenderBufferVisualization"); connectRefreshCachedSettingsSafe("RenderMirrors"); connectRefreshCachedSettingsSafe("RenderHeroProbeUpdateRate"); + connectRefreshCachedSettingsSafe("RenderHeroProbeConservativeUpdateMultiplier"); gSavedSettings.getControl("RenderAutoHideSurfaceAreaLimit")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings)); } @@ -1074,6 +1076,7 @@ void LLPipeline::refreshCachedSettings() LLViewerShaderMgr::instance()->setShaders(); } RenderHeroProbeUpdateRate = gSavedSettings.getS32("RenderHeroProbeUpdateRate"); + RenderHeroProbeConservativeUpdateMultiplier = gSavedSettings.getS32("RenderHeroProbeConservativeUpdateMultiplier"); sReflectionProbesEnabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionsEnabled") && gSavedSettings.getBOOL("RenderReflectionsEnabled"); RenderSpotLight = nullptr; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index fe00c52e6d..817750b4a1 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -1057,6 +1057,7 @@ public: static S32 RenderBufferVisualization; static bool RenderMirrors; static S32 RenderHeroProbeUpdateRate; + static S32 RenderHeroProbeConservativeUpdateMultiplier; }; void render_bbox(const LLVector3 &min, const LLVector3 &max); -- cgit v1.2.3