From 3dd791eb8489f58c1cc4197557c40bd7f45a965b Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Sat, 14 Dec 2024 14:20:50 +0100 Subject: [PATCH] Changed velocity factor integration in a way that isn't stupid --- Runtime/FSR3/Fsr3Upscaler.cs | 1 + Runtime/FSR3/Fsr3UpscalerContext.cs | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Runtime/FSR3/Fsr3Upscaler.cs b/Runtime/FSR3/Fsr3Upscaler.cs index 374db52..6b3ad77 100644 --- a/Runtime/FSR3/Fsr3Upscaler.cs +++ b/Runtime/FSR3/Fsr3Upscaler.cs @@ -200,6 +200,7 @@ namespace FidelityFX.FSR3 public float CameraFar; public float CameraFovAngleVertical; public float ViewSpaceToMetersFactor; + public float VelocityFactor = 1.0f; public DispatchFlags Flags; public bool UseTextureArrays; // Enable texture array bindings, primarily used for HDRP and XR diff --git a/Runtime/FSR3/Fsr3UpscalerContext.cs b/Runtime/FSR3/Fsr3UpscalerContext.cs index 75ad8f9..07f1af7 100644 --- a/Runtime/FSR3/Fsr3UpscalerContext.cs +++ b/Runtime/FSR3/Fsr3UpscalerContext.cs @@ -34,11 +34,6 @@ namespace FidelityFX.FSR3 public class Fsr3UpscalerContext { private const int MaxQueuedFrames = 16; - - public float VelocityFactor - { - set => UpscalerConsts.velocityFactor = Mathf.Clamp01(value); - } private Fsr3Upscaler.ContextDescription _contextDescription; private CommandBuffer _commandBuffer; @@ -413,6 +408,8 @@ namespace FidelityFX.FSR3 constants.frameIndex = 0; else constants.frameIndex += 1.0f; + + constants.velocityFactor = dispatchParams.VelocityFactor; } private Vector4 SetupDeviceDepthToViewSpaceDepthParams(Fsr3Upscaler.DispatchDescription dispatchParams)