From 52f815e240d3dd976f3c3bdb2d9f6e980d4e36d1 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 14 Jun 2019 15:38:03 -0700 Subject: [PATCH] Properly inverse the projection matrix for the shader Some projections matrices were incorrectly inverted. This also fix #1281, fortunately, the incorrect matrix wasn't used in that case. Camera::inverseProjection only handles projection matrices it created (as opposed to custom ones, which is what the shadowmap code uses) --- filament/src/View.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filament/src/View.cpp b/filament/src/View.cpp index 78632f6ab6..e17c5c03e0 100644 --- a/filament/src/View.cpp +++ b/filament/src/View.cpp @@ -609,7 +609,7 @@ void FView::prepareCamera(const CameraInfo& camera, const filament::Viewport& vi const mat4f projectionMatrix(camera.projection); const mat4f clipFromView(projectionMatrix); - const mat4f viewFromClip(Camera::inverseProjection(clipFromView)); + const mat4f viewFromClip(inverse(clipFromView)); const mat4f clipFromWorld(clipFromView * viewFromWorld); const mat4f worldFromClip(worldFromView * viewFromClip);