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)
This commit is contained in:
Mathias Agopian
2019-06-14 15:38:03 -07:00
committed by Mathias Agopian
parent 83b329c123
commit 52f815e240

View File

@@ -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);