From 81349ced5d07c15985679f035e77877e0269d6ce Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 8 Feb 2025 11:09:58 +0900 Subject: [PATCH] [vulkan] Correct another sign error in QFV_PerspectiveTanFar It turns out it was completely tangled up when I first wrote it. The previous correction got things mostly right, but the overall sign was wrong (ie, it gave -1..0 instead of 1..0) --- libs/video/renderer/vulkan/projection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/video/renderer/vulkan/projection.c b/libs/video/renderer/vulkan/projection.c index c0c5d50e9..4f5a79b5c 100644 --- a/libs/video/renderer/vulkan/projection.c +++ b/libs/video/renderer/vulkan/projection.c @@ -146,8 +146,8 @@ QFV_PerspectiveTanFar (mat4f_t proj, float fov_x, float fov_y, proj[0] = (vec4f_t) { 1/fx, 0, 0, 0 }; proj[1] = (vec4f_t) { 0, 1/fy, 0, 0 }; - proj[2] = (vec4f_t) { 0, 0, -n/(n-f), 1 }; - proj[3] = (vec4f_t) { 0, 0, n*f/(n-f), 0 }; + proj[2] = (vec4f_t) { 0, 0, -n/(f-n), 1 }; + proj[3] = (vec4f_t) { 0, 0, n*f/(f-n), 0 }; } void