diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-06-11 20:56:02 -0700 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-06-11 20:56:02 -0700 |
commit | ffac2df6caedf48f30b3913386ea6e4c82ae5a0b (patch) | |
tree | c5e5a0541b318551cc04b6b7108f8f9025c6b72d /indra/llinventory | |
parent | 47e311d6e8b9996de3e0a1ac75c13724ce7735aa (diff) | |
parent | 1ebfc1876ec3383067a2399218037a33601b04d5 (diff) |
Merge branch 'DRTVWR-559' into DRTVWR-583-glossy-ssr
Diffstat (limited to 'indra/llinventory')
-rw-r--r-- | indra/llinventory/llsettingsbase.cpp | 1 | ||||
-rw-r--r-- | indra/llinventory/llsettingsbase.h | 1 | ||||
-rw-r--r-- | indra/llinventory/llsettingssky.cpp | 17 | ||||
-rw-r--r-- | indra/llinventory/llsettingssky.h | 13 |
4 files changed, 26 insertions, 6 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index 936b166409..bcf8bf6264 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -693,6 +693,7 @@ void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf) F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in) { LLSettingsBase::TrackPosition blendf = blendf_in; + llassert(!isnan(blendf)); if (blendf >= 1.0) { triggerComplete(); diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 1f0589f571..50276b801a 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -467,6 +467,7 @@ protected: class LLSettingsBlenderTimeDelta : public LLSettingsBlender { +protected: LOG_CLASS(LLSettingsBlenderTimeDelta); public: static const LLSettingsBase::BlendFactor MIN_BLEND_DELTA; 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; } diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 7ae569dd4c..f55e9f0631 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -134,10 +134,12 @@ public: F32 getSkyIceLevel() const; // get the probe ambiance setting as stored in the sky settings asset - F32 getReflectionProbeAmbiance() const; + // auto_adjust - if true and canAutoAdjust() is true, return 1.0 + F32 getReflectionProbeAmbiance(bool auto_adjust = false) const; // get the probe ambiance setting to use for rendering (adjusted by cloud shadow, aka cloud coverage) - F32 getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const; + // auto_adjust - if true and canAutoAdjust() is true, return 1.0 + F32 getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale, bool auto_adjust = false) const; // Return first (only) profile layer represented in LLSD LLSD getRayleighConfig() const; @@ -334,6 +336,10 @@ public: F32 aniso_factor = 0.0f); virtual void updateSettings() SETTINGS_OVERRIDE; + + // if true, this sky is a candidate for auto-adjustment + bool canAutoAdjust() const { return mCanAutoAdjust; } + protected: static const std::string SETTING_LEGACY_EAST_ANGLE; static const std::string SETTING_LEGACY_ENABLE_CLOUD_SCROLL; @@ -377,6 +383,9 @@ private: mutable LLColor4 mTotalAmbient; mutable LLColor4 mHazeColor; + // if true, this sky is a candidate for auto adjustment + bool mCanAutoAdjust = true; + typedef std::map<std::string, S32> mapNameToUniformId_t; static mapNameToUniformId_t sNameToUniformMapping; |