summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingssky.cpp
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-06-01 19:49:23 -0500
committerGitHub <noreply@github.com>2023-06-01 19:49:23 -0500
commit50ec54831de88926ca13c9a72d89006ceda6c355 (patch)
tree7f1efd2a8555fc419af29eaf0a47b4828df0d22b /indra/llinventory/llsettingssky.cpp
parent8d20d61b4d305b985de4837bb0ed3ddaedb208d1 (diff)
DRTVWR-559 Revert skies to be very close to release and disable tone mapping when probe ambiance is zero.
Hack for desaturating legacy materials has been removed for performance and quality reasons. Adds a new setting for auto adjusting legacy skies. This is the PBR "opt out" button. If disabled, legacy skies will disable tonemapping, automatic probe ambiance, and HDR/exposure. If enabled, legacy skies will behave as if probe ambiance and HDR scale are 1.0, and ambient will be cut in half. HDR scale will act as a sky brightener, but will automatically adjust dynamic exposure so the sky will be properly exposed. If you want relatively even exposure all the time, set HDR Scale to 1.0. If you want a high range of exposures between indoor/dark areas and outdoor/bright areas, increase HDR Scale. Also tuned up SSAO (thanks Rye!). Reviewed with Brad.
Diffstat (limited to 'indra/llinventory/llsettingssky.cpp')
-rw-r--r--indra/llinventory/llsettingssky.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index eb8385281c..6521ec8b43 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -403,6 +403,7 @@ LLSettingsSky::LLSettingsSky(const LLSD &data) :
mNextRainbowTextureId(),
mNextHaloTextureId()
{
+ mCanAutoAdjust = !data.has(SETTING_REFLECTION_PROBE_AMBIANCE);
}
LLSettingsSky::LLSettingsSky():
@@ -425,6 +426,8 @@ void LLSettingsSky::replaceSettings(LLSD settings)
mNextBloomTextureId.setNull();
mNextRainbowTextureId.setNull();
mNextHaloTextureId.setNull();
+
+ mCanAutoAdjust = !settings.has(SETTING_REFLECTION_PROBE_AMBIANCE);
}
void LLSettingsSky::replaceWithSky(LLSettingsSky::ptr_t pother)
@@ -437,6 +440,7 @@ void LLSettingsSky::replaceWithSky(LLSettingsSky::ptr_t pother)
mNextBloomTextureId = pother->mNextBloomTextureId;
mNextRainbowTextureId = pother->mNextRainbowTextureId;
mNextHaloTextureId = pother->mNextHaloTextureId;
+ mCanAutoAdjust = pother->mCanAutoAdjust;
}
void LLSettingsSky::blend(const LLSettingsBase::ptr_t &end, F64 blendf)
@@ -1429,18 +1433,23 @@ F32 LLSettingsSky::getSkyIceLevel() const
return mSettings[SETTING_SKY_ICE_LEVEL].asReal();
}
-F32 LLSettingsSky::getReflectionProbeAmbiance() const
+F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const
{
+ if (auto_adjust && canAutoAdjust())
+ {
+ return 1.f;
+ }
+
return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal();
}
-F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const
+F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale, bool auto_adjust) const
{
// feed cloud shadow back into reflection probe ambiance to mimic pre-reflection-probe behavior
// without brightening dark/interior spaces
- F32 probe_ambiance = getReflectionProbeAmbiance();
+ F32 probe_ambiance = getReflectionProbeAmbiance(auto_adjust);
- if (probe_ambiance > 0.f)
+ if (probe_ambiance > 0.f && probe_ambiance < 1.f)
{
probe_ambiance += (1.f - probe_ambiance) * getCloudShadow() * cloud_shadow_scale;
}