From 587289e1063e0c2a4227994675996b2a12bd974e Mon Sep 17 00:00:00 2001 From: papadanku <115061077+papadanku@users.noreply.github.com> Date: Tue, 9 Jul 2024 22:04:29 -0700 Subject: [PATCH] cCamera: Added exposure compensation range --- shaders/shared/cCamera.fxh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/shaders/shared/cCamera.fxh b/shaders/shared/cCamera.fxh index ce21579..dd9df57 100644 --- a/shaders/shared/cCamera.fxh +++ b/shaders/shared/cCamera.fxh @@ -34,15 +34,25 @@ ui_label = "Exposure Compensation"; ui_type = "slider"; ui_step = 0.001; - ui_min = -3.0; - ui_max = 3.0; + ui_min = -4.0; + ui_max = 4.0; > = 0.0; + uniform float _CShadeExposureRange < + ui_category = "Output: AutoExposure"; + ui_label = "Exposure Compensation Range"; + ui_type = "slider"; + ui_step = 0.001; + ui_min = 0.0; + ui_max = 4.0; + > = 1.0; + float3 ApplyAutoExposure(float3 Color, float Luma) { float LumaAverage = exp(Luma); float Ev100 = log2(LumaAverage * 100.0 / 12.5); Ev100 -= _CShadeExposureBias; // optional manual bias + Ev100 = clamp(Ev100, -_CShadeExposureRange, _CShadeExposureRange); float Exposure = 1.0 / (1.2 * exp2(Ev100)); return Color * Exposure; }