Skip to content

Commit

Permalink
[RYZA2] Add new Hue Correction
Browse files Browse the repository at this point in the history
- Added the latest implementation of hue correction to Ryza2
  • Loading branch information
marat569 authored Aug 11, 2024
1 parent 559761e commit b58c4ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/games/ryza2/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/games/ryza2/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct ShaderInjectData {
float colorGradeContrast;
float colorGradeSaturation;
float colorGradeBlowout;
float toneMapHueCorrection;
float blend;
float bloom;
float fxBloom;
Expand Down
3 changes: 2 additions & 1 deletion src/games/ryza2/tonemapper.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b58c4ad

Please sign in to comment.