diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/2_pass_cs/sgsr2_convert.compute b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/2_pass_cs/sgsr2_convert.compute index aa214fe..5d4711e 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/2_pass_cs/sgsr2_convert.compute +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/2_pass_cs/sgsr2_convert.compute @@ -68,7 +68,7 @@ void CS(uint3 gl_GlobalInvocationID : SV_DispatchThreadID) float2 EncodedVelocity = LOAD_TEXTURE2D_X(InputVelocity, InputPos); float2 motion; - if (EncodedVelocity.x > 0.0) + if (any(abs(EncodedVelocity) > 0.0)) { motion = decodeVelocityFromTexture(EncodedVelocity.xy); } diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/3_pass_cs/sgsr2_convert.compute b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/3_pass_cs/sgsr2_convert.compute index 33214e1..e049225 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/3_pass_cs/sgsr2_convert.compute +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/3_pass_cs/sgsr2_convert.compute @@ -58,7 +58,7 @@ void CS(uint3 gl_GlobalInvocationID : SV_DispatchThreadID) float2 EncodedVelocity = LOAD_TEXTURE2D_X(InputVelocity, InputPos); float2 motion; - if (EncodedVelocity.x > 0.0) + if (any(abs(EncodedVelocity) > 0.0)) { motion = decodeVelocityFromTexture(EncodedVelocity.xy); } diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_common.hlsl b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_common.hlsl index 56a5d1e..c79d47d 100644 --- a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_common.hlsl +++ b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_common.hlsl @@ -1,5 +1,7 @@ #define EPSILON 1.192e-07f +#define REQUEST_NDC_Y_UP + #ifdef UNITY_REVERSED_Z #define DEPTH_NEAREST(a, b) max((a), (b)) #define DEPTH_CLIP(depth) ((depth) > 1.0e-05f)