From c02baded8464781fcb208676610727e677ac6907 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Thu, 28 Nov 2024 17:57:30 -0500 Subject: #3170 Fix for tonemapping not working with PBR skies. --- indra/newview/llsettingsvo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llsettingsvo.cpp') diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index b1bef4c4d8..836b181623 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -804,10 +804,16 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) static LLCachedControl sunlight_scale(gSavedSettings, "RenderSkySunlightScale", 1.5f); static LLCachedControl sunlight_hdr_scale(gSavedSettings, "RenderHDRSkySunlightScale", 1.5f); static LLCachedControl ambient_scale(gSavedSettings, "RenderSkyAmbientScale", 1.5f); + static LLCachedControl tonemap_mix_setting(gSavedSettings, "RenderTonemapMix", 1.f); // sky is a "classic" sky following pre SL 7.0 shading bool classic_mode = psky->canAutoAdjust(); + if (!classic_mode) + { + psky->setTonemapMix(tonemap_mix_setting); + } + shader->uniform1f(LLShaderMgr::SKY_SUNLIGHT_SCALE, hdr ? sunlight_hdr_scale : sunlight_scale); shader->uniform1f(LLShaderMgr::SKY_AMBIENT_SCALE, ambient_scale); shader->uniform1i(LLShaderMgr::CLASSIC_MODE, classic_mode); -- cgit v1.2.3