Mark TemporalScale in SSR settings as deprecated and add a minor sharpening to SSR temporal filter

This commit is contained in:
Wojtek Figat
2026-01-16 11:20:06 +01:00
parent 9ac231c403
commit 593646061e
4 changed files with 8 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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.
/// </summary>
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;
/// <summary>
/// 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.

View File

@@ -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<float>(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)

View File

@@ -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);