Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDR Enhancements for Red Dead Redemption and minor improvements for Batman: Arkham Knight #96

Merged
merged 7 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/games/batmanak/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/date.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

Expand Down Expand Up @@ -357,6 +358,7 @@ renodx::utils::settings::Settings settings = {
.label = "More Mods",
.section = "Links",
.group = "button-line-1",
.tint = 0x2B3137,
.on_change = []() {
ShellExecute(0, "open", (std::string("https://github.com/") + "clshortfuse/renodx/wiki/Mods").c_str(), 0, 0, SW_SHOW);
},
Expand All @@ -366,6 +368,7 @@ renodx::utils::settings::Settings settings = {
.label = "Github",
.section = "Links",
.group = "button-line-1",
.tint = 0x2B3137,
.on_change = []() {
ShellExecute(0, "open", (std::string("https://github.com/") + "clshortfuse/renodx").c_str(), 0, 0, SW_SHOW);
},
Expand All @@ -375,11 +378,16 @@ renodx::utils::settings::Settings settings = {
.label = "ShortFuse's Ko-Fi",
.section = "Links",
.group = "button-line-1",
.tint = 0xFF5F5F,
.tint = 0xFF5A16,
.on_change = []() {
ShellExecute(0, "open", (std::string("https://ko-fi.com/") + "shortfuse").c_str(), 0, 0, SW_SHOW);
},
},
new renodx::utils::settings::Setting{
.value_type = renodx::utils::settings::SettingValueType::TEXT,
.label = std::string("Build: ") + renodx::utils::date::ISO_DATE_TIME,
.section = "About",
},
};

void OnPresetOff() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "./hueHelper.hlsl"
#include "./shared.h"

Texture2D<float4> g_textures2D[] : register(t0, space2);
Expand Down Expand Up @@ -32,6 +33,8 @@ float4 main(
float3 linearColor = renodx::color::gamma::DecodeSafe(gammaColor, 2.8);

if (injectedData.toneMapType != 0) {
linearColor = clampedHueOKLab(linearColor, injectedData.toneMapHueCorrection);

const float paperWhite = gameNits / renodx::color::srgb::REFERENCE_WHITE;
linearColor *= paperWhite;
const float peakWhite = injectedData.toneMapPeakNits / renodx::color::srgb::REFERENCE_WHITE;
Expand Down
27 changes: 9 additions & 18 deletions src/games/rdr1/PSMiniAdapt.0xE033AAAD.ps_6_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,7 @@ float4 main(
float midGrayScale = RDR1ReinhardMidgrayScale(White);
float3 untonemapped_scaled = color_scaled * midGrayScale;

float3 untonemappedBlendWeight;
if (injectedData.toneMapType == 0) { // Vanilla
untonemappedBlendWeight = 0;
} else if (injectedData.toneMapType == 1) {
untonemappedBlendWeight = 0.5;
} else {
untonemappedBlendWeight = 1; // Vanilla+ Boosted
}
float3 blendedColor = lerp(vanillaColor, lerp(vanillaColor, untonemapped_scaled, untonemappedBlendWeight), saturate(vanillaColor));
float3 blendedColor = injectedData.toneMapType ? lerp(vanillaColor, untonemapped_scaled, saturate(vanillaColor)) : vanillaColor;

_37 = blendedColor.r;
_38 = blendedColor.g;
Expand Down Expand Up @@ -198,21 +190,20 @@ float4 main(
if (injectedData.toneMapType == 0) {
desaturatedColorSDR = saturate(desaturatedColorHDR);
} else {
desaturatedColorSDR = saturate(renodx::tonemap::dice::BT709(desaturatedColorHDR, 1.0));
desaturatedColorSDR = renoDRTSmoothClamp(desaturatedColorHDR);
}
float3 contrastedColor = desaturatedColorSDR - (((desaturatedColorSDR * Contrast) * (desaturatedColorSDR - 1.0)) * (desaturatedColorSDR - 0.5));

float3 outputColor = contrastedColor;

#if 1 // use upgradetonemap() to apply SDR contrast to HDR
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp(saturate(vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
#endif
if (injectedData.toneMapType) {
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp((vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
}
float3 gammaEncodedColor = renodx::color::gamma::Encode(max(0, outputColor), 2.2f);
return float4(gammaEncodedColor, IntensityBloom);
}
27 changes: 9 additions & 18 deletions src/games/rdr1/PSRDR2PostfxOptics_0xEEEE53C5.ps_6_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,7 @@ float4 main(
float midGrayScale = RDR1ReinhardMidgrayScale(White);
float3 untonemapped_scaled = color_scaled * midGrayScale;

float3 untonemappedBlendWeight;
if (injectedData.toneMapType == 0) { // Vanilla
untonemappedBlendWeight = 0;
} else if (injectedData.toneMapType == 1) {
untonemappedBlendWeight = 0.5;
} else {
untonemappedBlendWeight = 1; // Vanilla+ Boosted
}
float3 blendedColor = lerp(vanillaColor, lerp(vanillaColor, untonemapped_scaled, untonemappedBlendWeight), saturate(vanillaColor));
float3 blendedColor = injectedData.toneMapType ? lerp(vanillaColor, untonemapped_scaled, saturate(vanillaColor)) : vanillaColor;

_191 = blendedColor.r;
_192 = blendedColor.g;
Expand Down Expand Up @@ -311,21 +303,20 @@ float4 main(
if (injectedData.toneMapType == 0) {
desaturatedColorSDR = saturate(desaturatedColorHDR);
} else {
desaturatedColorSDR = saturate(renodx::tonemap::dice::BT709(desaturatedColorHDR, 1.0));
desaturatedColorSDR = renoDRTSmoothClamp(desaturatedColorHDR);
}
float3 contrastedColor = desaturatedColorSDR - (((desaturatedColorSDR * Contrast) * (desaturatedColorSDR - 1.0)) * (desaturatedColorSDR - 0.5));

float3 outputColor = contrastedColor;

#if 1 // use upgradetonemap() to apply SDR contrast to HDR
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp(saturate(vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
#endif
if (injectedData.toneMapType) {
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp((vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
}
float3 gammaEncodedColor = renodx::color::gamma::Encode(max(0, outputColor), 2.2f);

return float4(gammaEncodedColor, 1.0);
Expand Down
27 changes: 9 additions & 18 deletions src/games/rdr1/PSRDR2PostfxSoftCutsceneDof.0x9761FB07.ps_6_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,7 @@ float4 main(float4 SV_Position: SV_POSITION,
float midGrayScale = RDR1ReinhardMidgrayScale(White);
float3 untonemapped_scaled = color_scaled * midGrayScale;

float3 untonemappedBlendWeight;
if (injectedData.toneMapType == 0) { // Vanilla
untonemappedBlendWeight = 0;
} else if (injectedData.toneMapType == 1) {
untonemappedBlendWeight = 0.5;
} else {
untonemappedBlendWeight = 1; // Vanilla+ Boosted
}
float3 blendedColor = lerp(vanillaColor, lerp(vanillaColor, untonemapped_scaled, untonemappedBlendWeight), saturate(vanillaColor));
float3 blendedColor = injectedData.toneMapType ? lerp(vanillaColor, untonemapped_scaled, saturate(vanillaColor)) : vanillaColor;

_140 = blendedColor.r;
_141 = blendedColor.g;
Expand Down Expand Up @@ -294,21 +286,20 @@ float4 main(float4 SV_Position: SV_POSITION,
if (injectedData.toneMapType == 0) {
desaturatedColorSDR = saturate(desaturatedColorHDR);
} else {
desaturatedColorSDR = saturate(renodx::tonemap::dice::BT709(desaturatedColorHDR, 1.0));
desaturatedColorSDR = renoDRTSmoothClamp(desaturatedColorHDR);
}
float3 contrastedColor = desaturatedColorSDR - (((desaturatedColorSDR * Contrast) * (desaturatedColorSDR - 1.0)) * (desaturatedColorSDR - 0.5));

float3 outputColor = contrastedColor;

#if 1 // use upgradetonemap() to apply SDR contrast to HDR
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp(saturate(vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
#endif
if (injectedData.toneMapType) {
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp((vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
}
float3 gammaEncodedColor = renodx::color::gamma::Encode(max(0, outputColor), 2.2f);

return float4(gammaEncodedColor, 1.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,7 @@ float4 main(float4 SV_Position: SV_POSITION,
float midGrayScale = RDR1ReinhardMidgrayScale(White);
float3 untonemapped_scaled = color_scaled * midGrayScale;

float3 untonemappedBlendWeight;
if (injectedData.toneMapType == 0) { // Vanilla
untonemappedBlendWeight = 0;
} else if (injectedData.toneMapType == 1) {
untonemappedBlendWeight = 0.5;
} else {
untonemappedBlendWeight = 1; // Vanilla+ Boosted
}
float3 blendedColor = lerp(vanillaColor, lerp(vanillaColor, untonemapped_scaled, untonemappedBlendWeight), saturate(vanillaColor));
float3 blendedColor = injectedData.toneMapType ? lerp(vanillaColor, untonemapped_scaled, saturate(vanillaColor)) : vanillaColor;

_211 = blendedColor.r;
_212 = blendedColor.g;
Expand Down Expand Up @@ -381,21 +373,20 @@ float4 main(float4 SV_Position: SV_POSITION,
if (injectedData.toneMapType == 0) {
desaturatedColorSDR = saturate(desaturatedColorHDR);
} else {
desaturatedColorSDR = saturate(renodx::tonemap::dice::BT709(desaturatedColorHDR, 1.0));
desaturatedColorSDR = renoDRTSmoothClamp(desaturatedColorHDR);
}
float3 contrastedColor = desaturatedColorSDR - (((desaturatedColorSDR * Contrast) * (desaturatedColorSDR - 1.0)) * (desaturatedColorSDR - 0.5));

float3 outputColor = contrastedColor;

#if 1 // use upgradetonemap() to apply SDR contrast to HDR
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp(saturate(vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
#endif
if (injectedData.toneMapType) {
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp((vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
}
float3 gammaEncodedColor = renodx::color::gamma::Encode(max(0, outputColor), 2.2f);

return float4(gammaEncodedColor, 1.0);
Expand Down
27 changes: 9 additions & 18 deletions src/games/rdr1/PSRDR2PostfxSoftDof.0xCCC43328.ps_6_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,7 @@ float4 main(float4 SV_Position: SV_POSITION,
float midGrayScale = RDR1ReinhardMidgrayScale(White);
float3 untonemapped_scaled = color_scaled * midGrayScale;

float3 untonemappedBlendWeight;
if (injectedData.toneMapType == 0) { // Vanilla
untonemappedBlendWeight = 0;
} else if (injectedData.toneMapType == 1) {
untonemappedBlendWeight = 0.5;
} else {
untonemappedBlendWeight = 1; // Vanilla+ Boosted
}
float3 blendedColor = lerp(vanillaColor, lerp(vanillaColor, untonemapped_scaled, untonemappedBlendWeight), saturate(vanillaColor));
float3 blendedColor = injectedData.toneMapType ? lerp(vanillaColor, untonemapped_scaled, saturate(vanillaColor)) : vanillaColor;

_93 = blendedColor.r;
_94 = blendedColor.g;
Expand Down Expand Up @@ -236,21 +228,20 @@ float4 main(float4 SV_Position: SV_POSITION,
if (injectedData.toneMapType == 0) {
desaturatedColorSDR = saturate(desaturatedColorHDR);
} else {
desaturatedColorSDR = saturate(renodx::tonemap::dice::BT709(desaturatedColorHDR, 1.0));
desaturatedColorSDR = renoDRTSmoothClamp(desaturatedColorHDR);
}
float3 contrastedColor = desaturatedColorSDR - (((desaturatedColorSDR * Contrast) * (desaturatedColorSDR - 1.0)) * (desaturatedColorSDR - 0.5));

float3 outputColor = contrastedColor;

#if 1 // use upgradetonemap() to apply SDR contrast to HDR
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp(saturate(vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
#endif
if (injectedData.toneMapType) {
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp((vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
}
// allowing negatives adds no wcg while causing artifacts in pause menu
float3 gammaEncodedColor = renodx::color::gamma::Encode(max(0, outputColor), 2.2f);

Expand Down
27 changes: 9 additions & 18 deletions src/games/rdr1/PSRDR2PostfxSoftDofOptics.0xE93AD74D.ps_6_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,7 @@ float4 main(
float midGrayScale = RDR1ReinhardMidgrayScale(White);
float3 untonemapped_scaled = color_scaled * midGrayScale;

float3 untonemappedBlendWeight;
if (injectedData.toneMapType == 0) { // Vanilla
untonemappedBlendWeight = 0;
} else if (injectedData.toneMapType == 1) {
untonemappedBlendWeight = 0.5;
} else {
untonemappedBlendWeight = 1; // Vanilla+ Boosted
}
float3 blendedColor = lerp(vanillaColor, lerp(vanillaColor, untonemapped_scaled, untonemappedBlendWeight), saturate(vanillaColor));
float3 blendedColor = injectedData.toneMapType ? lerp(vanillaColor, untonemapped_scaled, saturate(vanillaColor)) : vanillaColor;

_164 = blendedColor.r;
_165 = blendedColor.g;
Expand Down Expand Up @@ -295,21 +287,20 @@ float4 main(
if (injectedData.toneMapType == 0) {
desaturatedColorSDR = saturate(desaturatedColorHDR);
} else {
desaturatedColorSDR = saturate(renodx::tonemap::dice::BT709(desaturatedColorHDR, 1.0));
desaturatedColorSDR = renoDRTSmoothClamp(desaturatedColorHDR);
}
float3 contrastedColor = desaturatedColorSDR - (((desaturatedColorSDR * Contrast) * (desaturatedColorSDR - 1.0)) * (desaturatedColorSDR - 0.5));

float3 outputColor = contrastedColor;

#if 1 // use upgradetonemap() to apply SDR contrast to HDR
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp(saturate(vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
#endif
if (injectedData.toneMapType) {
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp((vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
}
float3 gammaEncodedColor = renodx::color::gamma::Encode(max(0, outputColor), 2.2f);
return float4(gammaEncodedColor, 1.0);
}
28 changes: 10 additions & 18 deletions src/games/rdr1/PSRDR2Postfx_0x4EAF2BC7.ps_6_0.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,7 @@ float4 main(float4 SV_Position: SV_POSITION,
float midGrayScale = RDR1ReinhardMidgrayScale(White);
float3 untonemapped_scaled = color_scaled * midGrayScale;

float3 untonemappedBlendWeight;
if (injectedData.toneMapType == 0) { // Vanilla
untonemappedBlendWeight = 0;
} else if (injectedData.toneMapType == 1) {
untonemappedBlendWeight = 0.5;
} else {
untonemappedBlendWeight = 1; // Vanilla+ Boosted
}
float3 blendedColor = lerp(vanillaColor, lerp(vanillaColor, untonemapped_scaled, untonemappedBlendWeight), saturate(vanillaColor));
float3 blendedColor = injectedData.toneMapType ? lerp(vanillaColor, untonemapped_scaled, saturate(vanillaColor)) : vanillaColor;

tonemappedColor = blendedColor;
#endif
Expand All @@ -173,20 +165,20 @@ float4 main(float4 SV_Position: SV_POSITION,
if (injectedData.toneMapType == 0) {
desaturatedColorSDR = saturate(desaturatedColorHDR);
} else {
desaturatedColorSDR = saturate(renodx::tonemap::dice::BT709(desaturatedColorHDR, 1.0));
desaturatedColorSDR = renoDRTSmoothClamp(desaturatedColorHDR);
}
float3 contrastedColor = desaturatedColorSDR - (((desaturatedColorSDR * Contrast) * (desaturatedColorSDR - 1.0)) * (desaturatedColorSDR - 0.5));

float3 outputColor = contrastedColor;

#if 1 // use upgradetonemap() to apply SDR contrast to HDR
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);

// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp(saturate(vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
#endif
if (injectedData.toneMapType) {
float3 upgradedColor = renodx::tonemap::UpgradeToneMap(desaturatedColorHDR, desaturatedColorSDR, outputColor, 1.f);
// blend vanillaColor back in to fix differences in contrast
float3 vanillaDesaturatedColor = saturate(desaturatedColorHDR);
float3 vanillaContrastedColor = vanillaDesaturatedColor - (((vanillaDesaturatedColor * Contrast) * (vanillaDesaturatedColor - 1.0)) * (vanillaDesaturatedColor - 0.5));
outputColor = lerp((vanillaContrastedColor), upgradedColor, saturate(vanillaContrastedColor));
}

// allowing negatives adds no wcg while causing artifacts in pause menu
float3 gammaEncodedColor = renodx::color::gamma::Encode(max(0, outputColor), 2.2f);
Expand Down
Loading