diff --git a/src/games/trailsdaybreak1/addon.cpp b/src/games/trailsdaybreak1/addon.cpp index fcf8cc13..a827360f 100644 --- a/src/games/trailsdaybreak1/addon.cpp +++ b/src/games/trailsdaybreak1/addon.cpp @@ -64,6 +64,17 @@ renodx::utils::settings::Settings settings = { .max = 500.f, }, + new renodx::utils::settings::Setting{ + .key = "toneMapHueCorrection", + .binding = &shader_injection.toneMapHueCorrection, + .default_value = 50.f, + .label = "Hue Correction", + .section = "Tone Mapping", + .tooltip = "Emulates hue shifting from the vanilla tonemapper", + .max = 100.f, + .parse = [](float value) { return value * 0.01f; }, + }, + new renodx::utils::settings::Setting{ .key = "gamma", .binding = &shader_injection.gamma, diff --git a/src/games/trailsdaybreak1/shared.h b/src/games/trailsdaybreak1/shared.h index ed2bd540..e22c9b36 100644 --- a/src/games/trailsdaybreak1/shared.h +++ b/src/games/trailsdaybreak1/shared.h @@ -18,6 +18,7 @@ struct ShaderInjectData { float colorGradeContrast; float colorGradeSaturation; float gamma; + float toneMapHueCorrection; }; #ifndef __cplusplus diff --git a/src/games/trailsdaybreak1/tonemapper.hlsl b/src/games/trailsdaybreak1/tonemapper.hlsl index c0888a0e..68fc7b44 100644 --- a/src/games/trailsdaybreak1/tonemapper.hlsl +++ b/src/games/trailsdaybreak1/tonemapper.hlsl @@ -21,8 +21,8 @@ float3 applyUserTonemap(float3 untonemapped) { injectedData.colorGradeShadows, // shadows injectedData.colorGradeContrast, // contrast 1.f, // saturation, we'll do this post-tonemap - 0.f, // dechroma, we don't need it - 0.f); // hue correction, might not need it [yet] + 0.f, // dechroma, post tonemapping + 0.f); // hue correction, Post tonemapping } // Start tonemapper if/else @@ -54,7 +54,8 @@ float3 applyUserTonemap(float3 untonemapped) { 1.f, // contrast injectedData.colorGradeSaturation, // saturation 0.f, // dechroma, we don't need it - 0.f); // hue correction, might not need it [yet] + injectedData.toneMapHueCorrection, // Hue Correction + renodx::tonemap::Reinhard(untonemapped)); } outputColor = renodx::color::bt709::clamp::BT2020(outputColor); // Clamp to BT2020 to avoid negative colorsF