Account for inverse viewport height when picking vertices

This commit is contained in:
baldurk
2020-11-02 21:11:50 +00:00
parent 41c57c0b68
commit 5006a787d9
4 changed files with 12 additions and 0 deletions
+3
View File
@@ -2891,6 +2891,9 @@ uint32_t D3D11Replay::PickVertex(uint32_t eventId, int32_t width, int32_t height
if(cfg.ortho)
guessProj = Matrix4f::Orthographic(cfg.position.nearPlane, cfg.position.farPlane);
if(cfg.position.flipY)
guessProj[5] *= -1.0f;
pickMVPProj = projMat.Mul(camMat.Mul(guessProj.Inverse()));
}
+3
View File
@@ -1762,6 +1762,9 @@ uint32_t D3D12Replay::PickVertex(uint32_t eventId, int32_t width, int32_t height
if(cfg.ortho)
guessProj = Matrix4f::Orthographic(cfg.position.nearPlane, cfg.position.farPlane);
if(cfg.position.flipY)
guessProj[5] *= -1.0f;
pickMVPProj = projMat.Mul(camMat.Mul(guessProj.Inverse()));
}
+3
View File
@@ -2210,6 +2210,9 @@ uint32_t GLReplay::PickVertex(uint32_t eventId, int32_t width, int32_t height,
if(cfg.ortho)
guessProj = Matrix4f::Orthographic(cfg.position.nearPlane, cfg.position.farPlane);
if(cfg.position.flipY)
guessProj[5] *= -1.0f;
pickMVPProj = projMat.Mul(camMat.Mul(guessProj.Inverse()));
}
+3
View File
@@ -1028,6 +1028,9 @@ uint32_t VulkanReplay::PickVertex(uint32_t eventId, int32_t w, int32_t h, const
if(cfg.ortho)
guessProj = Matrix4f::Orthographic(cfg.position.nearPlane, cfg.position.farPlane);
if(cfg.position.flipY)
guessProj[5] *= -1.0f;
pickMVPProj = projMat.Mul(camMat.Mul(guessProj.Inverse()));
}