EEVEE-Next: Mixed resolution with orthographic projection

When using mixed resolution rendering with an orthographic projection
the display was not correct. The reason was that the view boundaries
were decomposed from the winmat correctly, but when re-composing
the matrix it assumed to be in perspective.

This is fixed by composing an orthographic winmat when it was sourced
from a orthographic winmat.

Fixes #119514

Pull Request: https://projects.blender.org/blender/blender/pulls/119517
This commit is contained in:
Jeroen Bakker
2024-03-15 15:58:27 +01:00
parent ce5f864027
commit 17a70be68d

View File

@@ -226,12 +226,18 @@ void ShadingView::update_view()
float top;
float near;
float far;
const bool is_perspective = main_view_.is_persp();
projmat_dimensions(winmat.ptr(), &left, &right, &bottom, &top, &near, &far);
float2 scale = (float2(rescaled_render_extent) / float2(display_extent));
right = left + ((right - left) * scale.x);
top = bottom + ((top - bottom) * scale.y);
winmat = math::projection::perspective(left, right, bottom, top, near, far);
if (is_perspective) {
winmat = math::projection::perspective(left, right, bottom, top, near, far);
}
else {
winmat = math::projection::orthographic(left, right, bottom, top, near, far);
}
}
/* Anti-Aliasing / Super-Sampling jitter. */