diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index d4e616abc2d464013e0205dd10609dbdc8bdcaa1..4004793ffdb8cceb9819a7f737e183c708f04b62 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -1437,6 +1437,16 @@ F32 LLSettingsSky::getReflectionProbeAmbiance() const return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal(); } +F32 LLSettingsSky::getTotalReflectionProbeAmbiance() 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; + + return probe_ambiance; +} + F32 LLSettingsSky::getSkyBottomRadius() const { return mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal(); diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 715d31518b99f181205e11cbe22c9a748774a3db..b17b32ebb13478ab420d3c8b21cc4c820f78034f 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -133,8 +133,12 @@ class LLSettingsSky: public LLSettingsBase F32 getSkyDropletRadius() const; F32 getSkyIceLevel() const; + // get the probe ambiance setting as stored in the sky settings asset F32 getReflectionProbeAmbiance() const; + // get the probe ambiance setting to use for rendering (adjusted by cloud shadow, aka cloud coverage) + F32 getTotalReflectionProbeAmbiance() const; + // Return first (only) profile layer represented in LLSD LLSD getRayleighConfig() const; LLSD getMieConfig() const; diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 088b83a8e92c307efda8505ed47ce2692be9a2f8..1472abcec2ee0871c79d160a4f8d5e36fa9c26c0 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -695,7 +695,7 @@ void LLReflectionMapManager::updateUniforms() LLEnvironment& environment = LLEnvironment::instance(); LLSettingsSky::ptr_t psky = environment.getCurrentSky(); - F32 minimum_ambiance = psky->getReflectionProbeAmbiance(); + F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance(); for (auto* refmap : mReflectionMaps) { diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 59cfb4f0c467fed54049964960880bc6b5074d75..870ac6bd5a5d4d940f3a225bdd7fc7d7c39d9b3f 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -717,7 +717,8 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) shader->uniform3fv(LLShaderMgr::AMBIENT_LINEAR, linearColor3v(getAmbientColor()/3.f)); // note magic number 3.f comes from SLIDER_SCALE_SUN_AMBIENT shader->uniform3fv(LLShaderMgr::SUNLIGHT_LINEAR, linearColor3v(getSunlightColor())); shader->uniform3fv(LLShaderMgr::MOONLIGHT_LINEAR,linearColor3v(getMoonlightColor())); - shader->uniform1f(LLShaderMgr::REFLECTION_PROBE_AMBIANCE, getReflectionProbeAmbiance()); + + shader->uniform1f(LLShaderMgr::REFLECTION_PROBE_AMBIANCE, getTotalReflectionProbeAmbiance()); shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, getIsSunUp() ? 1 : 0); shader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, getSunMoonGlowFactor());