diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-12-10 13:02:09 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-12-10 13:02:09 +0800 |
commit | 91cc1af25286c9a1a55bd99949a4d02cb19c2a3e (patch) | |
tree | 7439f3aee7dfa9c29e67264b2a7ab13789f1fa4d /indra/newview | |
parent | 70e36b3ff4673888a951f1f3487176ec3ca44fe5 (diff) | |
parent | c162d8a060e9b48a7945eb0b1bdafbff959b7faf (diff) |
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 22 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 35 |
3 files changed, 38 insertions, 30 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a69c09d696..66813e8a67 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9364,6 +9364,17 @@ <key>Value</key> <real>4.0</real> </map> + <key>RenderUseExposureSkySettings</key> + <map> + <key>Comment</key> + <string>Use exposure sky settings instead of deriving from HDR scale.</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>RenderDynamicExposureCoefficient</key> <map> <key>Comment</key> diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 14647d6f84..36b6787ace 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -582,31 +582,9 @@ void LLViewerTexture::updateClass() { if (!was_backgrounded) { - std::string notification_name; - std::string setting; - if (is_minimized) - { - notification_name = "TextureDiscardMinimized"; - setting = "TextureDiscardMinimizedTime"; - } - else - { - notification_name = "TextureDiscardBackgrounded"; - setting = "TextureDiscardBackgroundedTime"; - } - LL_INFOS() << "Viewer was " << (is_minimized ? "minimized" : "backgrounded") << " for " << discard_time << "s, freeing up video memory." << LL_ENDL; - LLNotificationsUtil::add(notification_name, llsd::map("DELAY", discard_time), LLSD(), - [=](const LLSD& notification, const LLSD& response) - { - if (response["Cancel_okcancelignore"].asBoolean()) - { - LL_INFOS() << "User chose to disable texture discard on " << (is_minimized ? "minimizing." : "backgrounding.") << LL_ENDL; - gSavedSettings.setF32(setting, -1.f); - } - }); last_desired_discard_bias = sDesiredDiscardBias; was_backgrounded = true; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 47c2f2ffa9..85af326005 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7119,18 +7119,37 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool LLSettingsSky::ptr_t sky = LLEnvironment::instance().getCurrentSky(); F32 probe_ambiance = LLEnvironment::instance().getCurrentSky()->getReflectionProbeAmbiance(should_auto_adjust); - F32 exp_min = sky->getHDRMin(); - F32 exp_max = sky->getHDRMax(); - if (dynamic_exposure_enabled) + F32 exp_min = 1.f; + F32 exp_max = 1.f; + + static LLCachedControl<bool> use_exposure_sky_settings(gSavedSettings, "RenderUseExposureSkySettings", false); + + if (use_exposure_sky_settings) { - exp_min = sky->getHDROffset() - exp_min; - exp_max = sky->getHDROffset() + exp_max; + if (dynamic_exposure_enabled) + { + exp_min = sky->getHDROffset() - sky->getHDRMin(); + exp_max = sky->getHDROffset() + sky->getHDRMax(); + } + else + { + exp_min = sky->getHDROffset(); + exp_max = sky->getHDROffset(); + } } - else + else if (dynamic_exposure_enabled) { - exp_min = sky->getHDROffset(); - exp_max = sky->getHDROffset(); + if (probe_ambiance > 0.f) + { + F32 hdr_scale = sqrtf(LLEnvironment::instance().getCurrentSky()->getGamma()) * 2.f; + + if (hdr_scale > 1.f) + { + exp_min = 1.f / hdr_scale; + exp_max = hdr_scale; + } + } } shader->uniform1f(dt, gFrameIntervalSeconds); |