From b58c4ad97e72384883f3b76b6b8b44dccd9fc1c4 Mon Sep 17 00:00:00 2001 From: marat569 Date: Sun, 11 Aug 2024 18:19:53 -0400 Subject: [PATCH] [RYZA2] Add new Hue Correction - Added the latest implementation of hue correction to Ryza2 --- src/games/ryza2/addon.cpp | 11 +++++++++++ src/games/ryza2/shared.h | 1 + src/games/ryza2/tonemapper.hlsl | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/games/ryza2/addon.cpp b/src/games/ryza2/addon.cpp index 8c5eceac..d4815be6 100644 --- a/src/games/ryza2/addon.cpp +++ b/src/games/ryza2/addon.cpp @@ -156,6 +156,16 @@ renodx::utils::settings::Settings settings = { .parse = [](float value) { return value * 0.01f; }, }, + new renodx::utils::settings::Setting{ + .key = "toneMapHueCorrection", + .binding = &shader_injection.toneMapHueCorrection, + .default_value = 50.f, + .label = "Hue Correction", + .section = "Color Grading", + .tooltip = "Emulates hue shifting from the vanilla tonemapper", + .max = 100.f, + .parse = [](float value) { return value * 0.01f; }, + }, new renodx::utils::settings::Setting{ .key = "blend", @@ -217,6 +227,7 @@ void OnPresetOff() { renodx::utils::settings::UpdateSetting("colorGradeContrast", 50.f); renodx::utils::settings::UpdateSetting("colorGradeSaturation", 50.f); renodx::utils::settings::UpdateSetting("colorGradeBlowout", 50.f); + renodx::utils::settings::UpdateSetting("toneMapHueCorrection", 50.f); renodx::utils::settings::UpdateSetting("blend", 0); //Start PostProcess effects on/off renodx::utils::settings::UpdateSetting("bloom", 1); diff --git a/src/games/ryza2/shared.h b/src/games/ryza2/shared.h index d33b529a..8c874db7 100644 --- a/src/games/ryza2/shared.h +++ b/src/games/ryza2/shared.h @@ -18,6 +18,7 @@ struct ShaderInjectData { float colorGradeContrast; float colorGradeSaturation; float colorGradeBlowout; + float toneMapHueCorrection; float blend; float bloom; float fxBloom; diff --git a/src/games/ryza2/tonemapper.hlsl b/src/games/ryza2/tonemapper.hlsl index 981fd454..5b1e9e98 100644 --- a/src/games/ryza2/tonemapper.hlsl +++ b/src/games/ryza2/tonemapper.hlsl @@ -45,7 +45,8 @@ float3 applyUserTonemap(float3 untonemapped, float3 vanillaColor, float midGray) renoDRTContrast, renoDRTSaturation, renoDRTDechroma, - renoDRTFlare); + renoDRTFlare, + renodx::tonemap::config::hue_correction_type::CUSTOM, (injectedData.toneMapHueCorrection), vanillaColor); outputColor = renodx::tonemap::config::Apply(outputColor, config);