Fix: EEVEE-Next: Quick fix for overscan

With the recent changes introduced by the mixed resolution rendering
overscan and border rendering broke. Overscan is also used by the test
cases and fails the current tests.

This is a quick fix to get the overscan working.

NOTE: overscan + mixed resolution rendering will look blurry.
NOTE: this doesn't fix border rendering.
This commit is contained in:
Jeroen Bakker
2024-03-15 12:01:32 +01:00
parent f3f79ef4bd
commit 96a8f5b36c

View File

@@ -215,8 +215,10 @@ void ShadingView::update_view()
* the render pixels. If they don't align, the winmat needs to be re-projected.
*/
int2 scaling_factor = int2(inst_.film.scaling_factor_get());
int2 rescaled_render_extent = extent_ * scaling_factor;
int2 display_extent = inst_.film.display_extent_get();
int2 overscan = inst_.film.get_data().render_offset - inst_.film.get_data().offset;
int2 rescaled_render_extent = (extent_ - 2 * overscan) * scaling_factor;
if (rescaled_render_extent != display_extent) {
float left;
float right;
@@ -228,6 +230,7 @@ void ShadingView::update_view()
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);
}