summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-01-02 17:31:23 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-01-02 20:55:17 +0200
commita27515748fd1fd14a12ffc7f12b415decf6099de (patch)
treec841cdd4d3aa40b3520ebb37e0d94fbf792f4530
parentc88a7d1d274b090f5ca7484a8b1f3ccc36aa1980 (diff)
#3311 RenderSkyAutoAdjustLegacy does not engage tonemapper
-rw-r--r--indra/llinventory/llsettingssky.cpp22
-rw-r--r--indra/llinventory/llsettingssky.h8
-rw-r--r--indra/newview/llsettingsvo.cpp2
-rw-r--r--indra/newview/pipeline.cpp14
4 files changed, 23 insertions, 23 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 50b458de14..be64578d54 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -2032,43 +2032,43 @@ F32 LLSettingsSky::getGamma() const
return mGamma;
}
-F32 LLSettingsSky::getHDRMin() const
+F32 LLSettingsSky::getHDRMin(bool auto_adjust) const
{
- if (mCanAutoAdjust)
+ if (mCanAutoAdjust && !auto_adjust)
return 0.f;
return mHDRMin;
}
-F32 LLSettingsSky::getHDRMax() const
+F32 LLSettingsSky::getHDRMax(bool auto_adjust) const
{
- if (mCanAutoAdjust)
+ if (mCanAutoAdjust && !auto_adjust)
return 0.f;
return mHDRMax;
}
-F32 LLSettingsSky::getHDROffset() const
+F32 LLSettingsSky::getHDROffset(bool auto_adjust) const
{
- if (mCanAutoAdjust)
+ if (mCanAutoAdjust && !auto_adjust)
return 1.0f;
return mHDROffset;
}
-F32 LLSettingsSky::getTonemapMix() const
+F32 LLSettingsSky::getTonemapMix(bool auto_adjust) const
{
- if (mCanAutoAdjust)
+ if (mCanAutoAdjust && !auto_adjust)
+ {
+ // legacy settings do not support tonemaping
return 0.0f;
+ }
return mTonemapMix;
}
void LLSettingsSky::setTonemapMix(F32 mix)
{
- if (mCanAutoAdjust)
- return;
-
mTonemapMix = mix;
}
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index 4c635fd946..801fafff4b 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -209,10 +209,10 @@ public:
F32 getGamma() const;
- F32 getHDRMin() const;
- F32 getHDRMax() const;
- F32 getHDROffset() const;
- F32 getTonemapMix() const;
+ F32 getHDRMin(bool auto_adjust = false) const;
+ F32 getHDRMax(bool auto_adjust = false) const;
+ F32 getHDROffset(bool auto_adjust = false) const;
+ F32 getTonemapMix(bool auto_adjust = false) const;
void setTonemapMix(F32 mix);
void setGamma(F32 val);
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index cf96072ae2..6f9d4a24bc 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -807,7 +807,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
static LLCachedControl<F32> tonemap_mix_setting(gSavedSettings, "RenderTonemapMix", 1.f);
// sky is a "classic" sky following pre SL 7.0 shading
- bool classic_mode = psky->canAutoAdjust();
+ bool classic_mode = psky->canAutoAdjust() && !should_auto_adjust();
if (!classic_mode)
{
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 1ca67dd88a..38f158c1df 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -7076,7 +7076,7 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool
LLSettingsSky::ptr_t sky = LLEnvironment::instance().getCurrentSky();
- F32 probe_ambiance = LLEnvironment::instance().getCurrentSky()->getReflectionProbeAmbiance(should_auto_adjust);
+ F32 probe_ambiance = LLEnvironment::instance().getCurrentSky()->getReflectionProbeAmbiance(should_auto_adjust());
F32 exp_min = 1.f;
F32 exp_max = 1.f;
@@ -7087,13 +7087,13 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool
{
if (dynamic_exposure_enabled)
{
- exp_min = sky->getHDROffset() - sky->getHDRMin();
- exp_max = sky->getHDROffset() + sky->getHDRMax();
+ exp_min = sky->getHDROffset(should_auto_adjust()) - sky->getHDRMin(should_auto_adjust());
+ exp_max = sky->getHDROffset(should_auto_adjust()) + sky->getHDRMax(should_auto_adjust());
}
else
{
- exp_min = sky->getHDROffset();
- exp_max = sky->getHDROffset();
+ exp_min = sky->getHDROffset(should_auto_adjust());
+ exp_max = sky->getHDROffset(should_auto_adjust());
}
}
else if (dynamic_exposure_enabled)
@@ -7113,7 +7113,7 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool
shader->uniform1f(dt, gFrameIntervalSeconds);
shader->uniform2f(noiseVec, ll_frand() * 2.0f - 1.0f, ll_frand() * 2.0f - 1.0f);
shader->uniform4f(dynamic_exposure_params, dynamic_exposure_coefficient, exp_min, exp_max, dynamic_exposure_speed_error);
- shader->uniform4f(dynamic_exposure_params2, sky->getHDROffset(), exp_min, exp_max, dynamic_exposure_speed_target);
+ shader->uniform4f(dynamic_exposure_params2, sky->getHDROffset(should_auto_adjust()), exp_min, exp_max, dynamic_exposure_speed_target);
mScreenTriangleVB->setBuffer();
mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3);
@@ -7171,7 +7171,7 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst)
static LLCachedControl<U32> tonemap_type_setting(gSavedSettings, "RenderTonemapType", 0U);
shader.uniform1i(tonemap_type, tonemap_type_setting);
- shader.uniform1f(tonemap_mix, psky->getTonemapMix());
+ shader.uniform1f(tonemap_mix, psky->getTonemapMix(should_auto_adjust()));
mScreenTriangleVB->setBuffer();
mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3);