From 5b6d7314eebf9f6dd50b99115b70f6db4a9c82bc Mon Sep 17 00:00:00 2001 From: doodlum <15017472+doodlum@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:42:28 +0100 Subject: [PATCH] chore(upscaling): reduce ghosting near camera --- features/Upscaling/Shaders/Features/Upscaling.ini | 2 +- features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/features/Upscaling/Shaders/Features/Upscaling.ini b/features/Upscaling/Shaders/Features/Upscaling.ini index 312d7ff985..de2206be54 100644 --- a/features/Upscaling/Shaders/Features/Upscaling.ini +++ b/features/Upscaling/Shaders/Features/Upscaling.ini @@ -1,2 +1,2 @@ [Info] -Version = 1-1-0 \ No newline at end of file +Version = 1-1-1 \ No newline at end of file diff --git a/features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl b/features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl index b30a551b93..8ddddeae08 100644 --- a/features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl +++ b/features/Upscaling/Shaders/Upscaling/EncodeTexturesCS.hlsl @@ -25,6 +25,7 @@ RWTexture2D MotionVectorOutput : register(u2); #if defined(DLSS) float depth = DepthMask[dispatchID.xy]; + float nearFactor = smoothstep(4096.0 * 2.5, 0.0, SharedData::GetScreenDepth(depth)); // Find longest motion vector in 5x5 neighborhood float2 motionVector = MotionVectorMask[dispatchID.xy]; @@ -58,7 +59,7 @@ RWTexture2D MotionVectorOutput : register(u2); } } - MotionVectorOutput[dispatchID.xy] = longestMotionVector; + MotionVectorOutput[dispatchID.xy] = lerp(longestMotionVector, motionVector, nearFactor); #endif float reactiveMask = taaMask.x * 0.1 + taaMask.y;