diff options
| author | RunitaiLinden <davep@lindenlab.com> | 2023-08-30 11:20:11 -0500 | 
|---|---|---|
| committer | RunitaiLinden <davep@lindenlab.com> | 2023-08-30 11:20:11 -0500 | 
| commit | 2ce27627a18787113c1b9a1fd99b5a516d693a8c (patch) | |
| tree | a5ca1cbfc9eed7ddf07c4575f6bfddeefb401b99 /indra/newview | |
| parent | 455bbcf742691b709353aa3c3e35a76d0ff38ee4 (diff) | |
SL-19842 Followup -- fix sunlight going black and make automatic object probes more wishy-washy (removes dark splotches where probes get stuck in walls)
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llreflectionmap.cpp | 9 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 14 | 
2 files changed, 21 insertions, 2 deletions
| diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp index a039c8072a..2a2f4dbd5a 100644 --- a/indra/newview/llreflectionmap.cpp +++ b/indra/newview/llreflectionmap.cpp @@ -157,6 +157,7 @@ void LLReflectionMap::autoAdjustOrigin()              }              mRadius = llmax(sqrtf(r2.getF32()), 8.f); +                      }      }      else if (mViewerObject) @@ -204,6 +205,14 @@ F32 LLReflectionMap::getNearClip()      {          ret = ((LLVOVolume*)mViewerObject)->getReflectionProbeNearClip();      } +    else if (mGroup) +    { +        ret = mRadius * 0.5f; // default to half radius for automatic object probes +    } +    else +    { +        ret = 1.f; // default to 1m for automatic terrain probes +    }      return llmax(ret, MINIMUM_NEAR_CLIP);  } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0b5908a440..78d4e65d42 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7730,8 +7730,18 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_  		shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_NORM_MATRIX, 1, FALSE, norm_mat.m);  	} -    //shader.uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, mSunDiffuse.mV); -    //shader.uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, 1, mMoonDiffuse.mV); +    // auto adjust legacy sun color if needed +    static LLCachedControl<bool> should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", true); +    static LLCachedControl<F32> auto_adjust_sun_color_scale(gSavedSettings, "RenderSkyAutoAdjustSunColorScale", 1.f); +    LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); +    LLColor3 sun_diffuse(mSunDiffuse.mV); +    if (should_auto_adjust && psky->canAutoAdjust()) +    { +        sun_diffuse *= auto_adjust_sun_color_scale; +    } + +    shader.uniform3fv(LLShaderMgr::SUNLIGHT_COLOR, 1, sun_diffuse.mV); +    shader.uniform3fv(LLShaderMgr::MOONLIGHT_COLOR, 1, mMoonDiffuse.mV);      shader.uniform1f(LLShaderMgr::REFLECTION_PROBE_MAX_LOD, mReflectionMapManager.mMaxProbeLOD);  } | 
