From cca15292c5112c650a1356a9056da98e34638ccf Mon Sep 17 00:00:00 2001 From: Tim <15017472+doodlum@users.noreply.github.com> Date: Fri, 22 Nov 2024 10:19:52 +0000 Subject: [PATCH] fix: tonemapping saturation --- package/Shaders/ISHDR.hlsl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/Shaders/ISHDR.hlsl b/package/Shaders/ISHDR.hlsl index 5cbf7b7f2..f7177cc62 100644 --- a/package/Shaders/ISHDR.hlsl +++ b/package/Shaders/ISHDR.hlsl @@ -112,11 +112,16 @@ PS_OUTPUT main(PS_INPUT input) blendedColor = GetTonemapFactorReinhard(inputColor); } + float blendedLuminance = Color::RGBToLuminance(blendedColor); + + // Compensate for modified tonemapping desaturating colors + blendedColor = lerp(blendedLuminance, blendedColor, 1.2); + blendedColor += saturate(Param.x - blendedColor) * bloomColor; gameSdrColor = blendedColor; - float blendedLuminance = Color::RGBToLuminance(blendedColor); + blendedLuminance = Color::RGBToLuminance(blendedColor); float3 linearColor = Cinematic.w * lerp(lerp(blendedLuminance, float4(blendedColor, 1), Cinematic.x), blendedLuminance * Tint, Tint.w).xyz;