From 593646061e627e448e168957d293c168ec0db6d2 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 16 Jan 2026 11:20:06 +0100 Subject: [PATCH] Mark `TemporalScale` in `SSR` settings as deprecated and add a minor sharpening to SSR temporal filter --- Source/Engine/Graphics/PostProcessSettings.cpp | 2 ++ Source/Engine/Graphics/PostProcessSettings.h | 2 +- Source/Engine/Renderer/ScreenSpaceReflectionsPass.cpp | 3 +-- Source/Shaders/SSR.shader | 5 ++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Graphics/PostProcessSettings.cpp b/Source/Engine/Graphics/PostProcessSettings.cpp index 43e89821e..029925840 100644 --- a/Source/Engine/Graphics/PostProcessSettings.cpp +++ b/Source/Engine/Graphics/PostProcessSettings.cpp @@ -187,7 +187,9 @@ void ScreenSpaceReflectionsSettings::BlendWith(ScreenSpaceReflectionsSettings& o BLEND_FLOAT(FadeDistance); BLEND_BOOL(UseColorBufferMips); BLEND_BOOL(TemporalEffect); +PRAGMA_DISABLE_DEPRECATION_WARNINGS BLEND_FLOAT(TemporalScale); +PRAGMA_ENABLE_DEPRECATION_WARNINGS BLEND_FLOAT(TemporalResponse); } diff --git a/Source/Engine/Graphics/PostProcessSettings.h b/Source/Engine/Graphics/PostProcessSettings.h index a300063e7..d7b5a9cb4 100644 --- a/Source/Engine/Graphics/PostProcessSettings.h +++ b/Source/Engine/Graphics/PostProcessSettings.h @@ -1833,7 +1833,7 @@ API_STRUCT() struct FLAXENGINE_API ScreenSpaceReflectionsSettings : ISerializabl /// The intensity of the temporal effect. Lower values produce reflections faster, but more noise. /// API_FIELD(Attributes="Limit(0, 20.0f, 0.5f), EditorOrder(55), PostProcessSetting((int)ScreenSpaceReflectionsSettingsOverride.TemporalScale)") - float TemporalScale = 8.0f; + DEPRECATED("TemporalScale of SSR is unsued now.") float TemporalScale = 8.0f; /// /// Defines how quickly reflections blend between the reflection in the current frame and the history buffer. Lower values produce reflections faster, but with more jittering. If the camera in your game doesn't move much, we recommend values closer to 1. diff --git a/Source/Engine/Renderer/ScreenSpaceReflectionsPass.cpp b/Source/Engine/Renderer/ScreenSpaceReflectionsPass.cpp index ab772a0d3..c57f19949 100644 --- a/Source/Engine/Renderer/ScreenSpaceReflectionsPass.cpp +++ b/Source/Engine/Renderer/ScreenSpaceReflectionsPass.cpp @@ -34,7 +34,7 @@ GPU_CB_STRUCT(Data { float WorldAntiSelfOcclusionBias; float EdgeFadeFactor; float TemporalResponse; - float TemporalScale; + float Dummy0; float RayTraceStep; float TemporalEffect; float Intensity; @@ -226,7 +226,6 @@ void ScreenSpaceReflectionsPass::Render(RenderContext& renderContext, GPUTexture data.RayTraceStep = static_cast(settings.DepthResolution) / (float)width; data.Intensity = settings.Intensity; data.FadeOutDistance = Math::Max(settings.FadeOutDistance, 100.0f); - data.TemporalScale = settings.TemporalScale; data.TemporalResponse = settings.TemporalResponse; data.TemporalEffect = useTemporal ? 1.0f : 0.0f; if (useTemporal) diff --git a/Source/Shaders/SSR.shader b/Source/Shaders/SSR.shader index 6fffbd2c6..4e88d6299 100644 --- a/Source/Shaders/SSR.shader +++ b/Source/Shaders/SSR.shader @@ -27,7 +27,7 @@ float BRDFBias; float WorldAntiSelfOcclusionBias; float EdgeFadeFactor; float TemporalResponse; -float TemporalScale; +float Dummy0; float RayTraceStep; float TemporalEffect; float Intensity; @@ -244,6 +244,9 @@ float4 PS_TemporalPass(Quad_VS2PS input) : SV_Target0 float4 currentSum = currentTopLeft + currentTopCenter + currentTopRight + currentMiddleLeft + currentMiddleCenter + currentMiddleRight + currentBottomLeft + currentBottomCenter + currentBottomRight; float4 currentAvg = currentSum / 9.0; + // Apply sharpening + current += (current - currentAvg) * 0.1f; + // Sample history by clamp it to the nearby colors range to reduce artifacts float lumaOffset = abs(Luminance(currentAvg.rgb) - Luminance(current.rgb)); float velocityLength = length(velocity);