Fix #134320: EEVEE: Crashes when leaving camera view back to orthographic
This happened because the interpolated winmat was degenerate. Using a fallback matrix in this case to avoid a crash.
This commit is contained in:
@@ -161,6 +161,12 @@ void Camera::sync()
|
||||
* In this case the produced winmat is degenerate. So just revert to the input matrix. */
|
||||
data.winmat = inst_.drw_view->winmat();
|
||||
}
|
||||
|
||||
if (isnan(data.winmat.w.x)) {
|
||||
/* Can happen in weird corner case (see #134320).
|
||||
* Simply fallback to something that we can render with. */
|
||||
data.winmat = math::projection::orthographic(0.01f, 0.01f, 0.01f, 0.01f, -1000.0f, +1000.0f);
|
||||
}
|
||||
}
|
||||
else if (inst_.render) {
|
||||
const Render *re = inst_.render->re;
|
||||
|
||||
Reference in New Issue
Block a user