From a3c99ff4c07b4ddec13c4b7875188b8da6944fa3 Mon Sep 17 00:00:00 2001 From: Rezmason Date: Wed, 27 Oct 2021 22:45:29 -0700 Subject: [PATCH] Swapping the camera perspective generating function to mat4.perspectiveZO. --- js/webgpu_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/webgpu_main.js b/js/webgpu_main.js index 8a6b548..a2b1d07 100644 --- a/js/webgpu_main.js +++ b/js/webgpu_main.js @@ -114,7 +114,7 @@ export default async (canvas, config) => { const updateCameraBuffer = () => { const canvasSize = canvasConfig.size; const aspectRatio = canvasSize[0] / canvasSize[1]; - mat4.perspective(camera, (Math.PI / 180) * 90, aspectRatio, 0.0001, 1000); + mat4.perspectiveZO(camera, (Math.PI / 180) * 90, aspectRatio, 0.0001, 1000); const screenSize = aspectRatio > 1 ? [1, aspectRatio] : [1 / aspectRatio, 1]; queue.writeBuffer(cameraBuffer, 0, new Float32Array([...screenSize, /* ??? */ -1, -1, ...camera, ...transform])); };