Skip to content

Commit

Permalink
feat(ue): sychronize changes
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Dec 26, 2024
1 parent 5ed698a commit f712122
Show file tree
Hide file tree
Showing 8 changed files with 2,767 additions and 16 deletions.
40 changes: 36 additions & 4 deletions src/games/ue-dx11/addon.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Carlos Lopez
* Copyright (C) 2024 Carlos Lopez
* SPDX-License-Identifier: MIT
*/

Expand All @@ -13,9 +13,12 @@

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


namespace {

renodx::mods::shader::CustomShaders custom_shaders = {
Expand Down Expand Up @@ -75,7 +78,7 @@ renodx::utils::settings::Settings settings = {
.key = "toneMapGammaCorrection",
.binding = &shader_injection.toneMapGammaCorrection,
.value_type = renodx::utils::settings::SettingValueType::INTEGER,
.default_value = 2.f,
.default_value = 1.f,
.label = "Gamma Correction",
.section = "Tone Mapping",
.tooltip = "Emulates a display EOTF."
Expand Down Expand Up @@ -200,18 +203,47 @@ renodx::utils::settings::Settings settings = {
.group = "button-line-1",
.tint = 0x5865F2,
.on_change = []() {
ShellExecute(0, "open", "https://discord.gg/5WZXDpmbpP", 0, 0, SW_SHOW);
renodx::utils::platform::Launch(
"https://discord.gg/"
// Anti-bot
"5WZXDpmbpP");
},
},
new renodx::utils::settings::Setting{
.value_type = renodx::utils::settings::SettingValueType::BUTTON,
.label = "More Mods",
.section = "Links",
.group = "button-line-1",
.tint = 0x2B3137,
.on_change = []() {
renodx::utils::platform::Launch("https://github.com/clshortfuse/renodx/wiki/Mods");
},
},
new renodx::utils::settings::Setting{
.value_type = renodx::utils::settings::SettingValueType::BUTTON,
.label = "Github",
.section = "Links",
.group = "button-line-1",
.tint = 0x2B3137,
.on_change = []() {
ShellExecute(0, "open", "https://github.com/clshortfuse/renodx", 0, 0, SW_SHOW);
renodx::utils::platform::Launch("https://github.com/clshortfuse/renodx");
},
},
new renodx::utils::settings::Setting{
.value_type = renodx::utils::settings::SettingValueType::BUTTON,
.label = "ShortFuse's Ko-Fi",
.section = "Links",
.group = "button-line-1",
.tint = 0xFF5A16,
.on_change = []() {
renodx::utils::platform::Launch("https://ko-fi.com/shortfuse");
},
},
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
4 changes: 4 additions & 0 deletions src/games/ue-dx11/common.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ float3 FinalizeOutput(float3 color) {
color *= injectedData.toneMapUINits;
color = min(color, injectedData.toneMapPeakNits); // Clamp UI or Videos

color = renodx::color::bt709::clamp::BT2020(color);

color /= 80.f;
return color;
}
Expand Down Expand Up @@ -153,7 +155,9 @@ float4 LutBuilderToneMap(float3 untonemapped_ap1, float3 tonemapped_bt709) {
1);

float3 color = ToneMap(untonemapped_graded);

color = PostToneMapScale(color);
color *= 1.f / 1.05f;
color = renodx::color::bt709::clamp::BT2020(color);
return float4(color, 1);
}
Loading

0 comments on commit f712122

Please sign in to comment.