EEVEE-Next: adding framebuffer viewport reset to Film

Fix #121782

`GPencil` engine renders on the whole framebuffer.
If `Render region` is used, the result of GP rendering is scaled from whole
framebuffer down to the selected region.

The fix adds framebuffer viewport reset after rendering.
This resolves the problem for downstream consumers of
the framebuffer (e.g. `GPencil`).

The final result is somewhat similar to the `EEVEE Legacy`.
Now `EEVEE` rendering is done in the selected region, while `GPencil`
is rendered on whole viewport as before.

Pull Request: https://projects.blender.org/blender/blender/pulls/121979
This commit is contained in:
Vitaljok
2024-05-19 19:02:02 +02:00
committed by Clément Foucault
parent 5a83346b47
commit 7d5cd60023

View File

@@ -112,6 +112,8 @@ static void eevee_draw_scene(void *vedata)
STRNCPY(ved->info, ved->instance->info.c_str());
/* Reset view for other following engines. */
DRW_view_set_active(nullptr);
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
GPU_framebuffer_viewport_reset(dfbl->default_fb);
}
static void eevee_cache_init(void *vedata)