#682 Further tweak the conservative update mechanism.

master
Jonathan "Geenz" Goodman 2024-02-26 01:21:41 -08:00
parent 1b8523a7b6
commit 8c79297a89
5 changed files with 22 additions and 3 deletions

View File

@ -10399,7 +10399,18 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
<real>1</real>
<integer>2</integer>
</map>
<key>RenderHeroProbeConservativeUpdateMultiplier</key>
<map>
<key>Comment</key>
<string>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.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>16</integer>
</map>
<key>RenderReflectionProbeVolumes</key>
<map>

View File

@ -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;
}

View File

@ -138,7 +138,6 @@ private:
std::map<int, int> mFaceUpdateList;
U32 mCurrentProbeUpdateFrame = 0;
U32 mLowPriorityFaceThrottle = 2;
std::vector<LLVOVolume*> mHeroVOList;
LLVOVolume* mNearestHero;

View File

@ -200,6 +200,7 @@ S32 LLPipeline::RenderScreenSpaceReflectionGlossySamples;
S32 LLPipeline::RenderBufferVisualization;
bool LLPipeline::RenderMirrors;
S32 LLPipeline::RenderHeroProbeUpdateRate;
S32 LLPipeline::RenderHeroProbeConservativeUpdateMultiplier;
LLTrace::EventStatHandle<S64> 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;

View File

@ -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);