diff --git a/src/games/unrealengine/common.hlsl b/src/games/unrealengine/common.hlsl index 342f7560..f9cfa8ce 100644 --- a/src/games/unrealengine/common.hlsl +++ b/src/games/unrealengine/common.hlsl @@ -16,11 +16,6 @@ float3 PostToneMapScale(float3 color) { color = renodx::color::srgb::EncodeSafe(color); } - // bg-sRGB should be clamped between -0.53f and 1.68f - // https://www.itu.int/dms_pub/itu-r/opb/rep/R-REP-BT.2380-2-2018-PDF-E.pdf - // Just clamp negative or else peak is limited - color = max(-0.53f, color); - return color; } @@ -111,6 +106,8 @@ float3 RenoDRTSmoothClamp(float3 untonemapped) { renodrt_config.hue_correction_strength = 0.f; renodrt_config.working_color_space = 0u; + // renodrt_config.tone_map_method = renodx::tonemap::renodrt::config::tone_map_method::REINHARD; + return renodx::tonemap::renodrt::BT709(untonemapped, renodrt_config); } @@ -134,7 +131,7 @@ float3 ToneMap(float3 bt709) { config.reno_drt_saturation = 1.05f; config.reno_drt_dechroma = 0; config.reno_drt_blowout = injectedData.colorGradeBlowout; - config.reno_drt_flare = 0.10f * injectedData.colorGradeFlare; + config.reno_drt_flare = 0.10f * pow(injectedData.colorGradeFlare, 10.f); config.reno_drt_working_color_space = 2u; config.reno_drt_per_channel = injectedData.toneMapPerChannel != 0; diff --git a/src/mods/swapchain.hpp b/src/mods/swapchain.hpp index 9e418119..60428c8b 100644 --- a/src/mods/swapchain.hpp +++ b/src/mods/swapchain.hpp @@ -952,8 +952,6 @@ static void OnInitResource( return; } - if (initial_data != nullptr) return; - auto& private_data = device->get_private_data(); const std::unique_lock lock(private_data.mutex); @@ -972,6 +970,7 @@ static void OnInitResource( return; } + bool changed = false; std::stringstream s; s << "mods::swapchain::OnInitResource(tracking "; s << reinterpret_cast(resource.handle); @@ -979,8 +978,10 @@ static void OnInitResource( s << ", state: " << std::hex << static_cast(initial_state) << std::dec; s << ", width: " << desc.texture.width; s << ", height: " << desc.texture.height; + s << ", initial_data: " << (initial_data == nullptr ? "false" : "true"); s << ", format: " << desc.texture.format; if (private_data.applied_target != nullptr) { + changed = true; if (private_data.applied_target->resource_tag != -1) { renodx::utils::resource::SetResourceTag(device, resource, private_data.applied_target->resource_tag); } @@ -1073,6 +1074,7 @@ static void OnInitResource( reshade::log::message(reshade::log::level::debug, s.str().c_str()); } } + changed = true; s << ", flagged: true"; } else { // Nothing to do @@ -1082,12 +1084,16 @@ static void OnInitResource( s << ")"; #ifdef DEBUG_LEVEL_1 - reshade::log::message( - desc.texture.format == reshade::api::format::unknown - ? reshade::log::level::warning - : reshade::log::level::info, - s.str().c_str()); + changed = true; #endif + + if (changed) { + reshade::log::message( + desc.texture.format == reshade::api::format::unknown + ? reshade::log::level::warning + : reshade::log::level::info, + s.str().c_str()); + } } static void OnDestroyResource(reshade::api::device* device, reshade::api::resource resource) {