From 7b4dca8586a21d56167d7c850a226c7c704e3931 Mon Sep 17 00:00:00 2001 From: Pawel Lapinski Date: Mon, 5 Feb 2018 14:52:26 +0100 Subject: [PATCH] Fixed calculation of projection matrices (aligned with the Vulkan Cookbook). --- Project/Common/Tools.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Project/Common/Tools.cpp b/Project/Common/Tools.cpp index 5a3fa9b..dc75219 100644 --- a/Project/Common/Tools.cpp +++ b/Project/Common/Tools.cpp @@ -108,18 +108,18 @@ namespace ApiWithoutSecrets { 0.0f, 0.0f, - f, + -f, 0.0f, 0.0f, 0.0f, 0.0f, - (near_clip + far_clip) / (near_clip - far_clip), + far_clip / (near_clip - far_clip), -1.0f, 0.0f, 0.0f, - (2.0f * near_clip * far_clip) / (near_clip - far_clip), + (near_clip * far_clip) / (near_clip - far_clip), 0.0f }; } @@ -143,12 +143,12 @@ namespace ApiWithoutSecrets { 0.0f, 0.0f, - -2.0f / (far_plane - near_plane), + 1.0f / (near_plane - far_plane), 0.0f, -(right_plane + left_plane) / (right_plane - left_plane), -(bottom_plane + top_plane) / (bottom_plane - top_plane), - -(far_plane + near_plane) / (far_plane - near_plane), + near_plane / (near_plane - far_plane), 1.0f }; }