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:
committed by
Mathias Agopian
parent
83b329c123
commit
52f815e240
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user