diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 4004793ffdb8cceb9819a7f737e183c708f04b62..c976307936ec83456b1d96f9c2ffdc34beb96cfe 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -1437,12 +1437,13 @@ F32 LLSettingsSky::getReflectionProbeAmbiance() const return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal(); } -F32 LLSettingsSky::getTotalReflectionProbeAmbiance() const +F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const { // feed cloud shadow back into reflection probe ambiance to mimic pre-reflection-probe behavior // without brightening dark/interior spaces F32 probe_ambiance = getReflectionProbeAmbiance(); - probe_ambiance += (1.f - probe_ambiance) * getCloudShadow()*0.5f; + + probe_ambiance += (1.f - probe_ambiance) * getCloudShadow()*cloud_shadow_scale; return probe_ambiance; } diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index b17b32ebb13478ab420d3c8b21cc4c820f78034f..7ae569dd4c70c5f860c6d8076d28226ce7d781e1 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -137,7 +137,7 @@ class LLSettingsSky: public LLSettingsBase F32 getReflectionProbeAmbiance() const; // get the probe ambiance setting to use for rendering (adjusted by cloud shadow, aka cloud coverage) - F32 getTotalReflectionProbeAmbiance() const; + F32 getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const; // Return first (only) profile layer represented in LLSD LLSD getRayleighConfig() const; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index bbf04a6889de188f9bf8f948b54c5033a090b4bd..304932dd1aa520ffeaeb9b318a5e47ebe34db169 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8828,6 +8828,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>RenderCloudShadowAmbianceFactor</key> + <map> + <key>Comment</key> + <string>Amount that cloud shadow (aka cloud coverage) contributes to reflection probe ambiance</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.1</real> + </map> <key>RenderComplexityColorMin</key> <map> <key>Comment</key> diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 4fd10b85ad4cf0b25e4f9f7f64ea8381df087a94..04bce58114c72e4b55c8e48f29988b0faaf7bb18 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -780,7 +780,9 @@ void LLReflectionMapManager::updateUniforms() LLEnvironment& environment = LLEnvironment::instance(); LLSettingsSky::ptr_t psky = environment.getCurrentSky(); - F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance(); + static LLCachedControl<F32> cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f); + F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance(cloud_shadow_scale); + F32 ambscale = gCubeSnapshot && !isRadiancePass() ? 0.f : 1.f; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index c3aaac3ede6ee3131668866c9a5f3bf6a3c0aa49..1752b2494f20e70340a64f659862cd58e565f465 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -733,7 +733,8 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) shader->uniform3fv(LLShaderMgr::SUNLIGHT_LINEAR, linearColor3v(sunDiffuse)); shader->uniform3fv(LLShaderMgr::MOONLIGHT_LINEAR,linearColor3v(moonDiffuse)); - shader->uniform1f(LLShaderMgr::REFLECTION_PROBE_AMBIANCE, getTotalReflectionProbeAmbiance()); + static LLCachedControl<F32> cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f); + shader->uniform1f(LLShaderMgr::REFLECTION_PROBE_AMBIANCE, getTotalReflectionProbeAmbiance(cloud_shadow_scale)); shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, getIsSunUp() ? 1 : 0); shader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, getSunMoonGlowFactor());