From 4f8cf086bf1a9c66077753ee70c6050759ad3f2c Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Sat, 21 Dec 2024 21:12:57 +0100 Subject: [PATCH] More specifically, set NDC Y-coordinate to be up when the Unity graphics API has UV's starting at the top --- .../Runtime/Effects/Upscaling/SGSR2/Shaders/sgsr2_common.hlsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 c79d47d..1a8902e 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,8 +1,10 @@ #define EPSILON 1.192e-07f +#if UNITY_UV_STARTS_AT_TOP #define REQUEST_NDC_Y_UP +#endif -#ifdef UNITY_REVERSED_Z +#if UNITY_REVERSED_Z #define DEPTH_NEAREST(a, b) max((a), (b)) #define DEPTH_CLIP(depth) ((depth) > 1.0e-05f) #else