diff options
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_engine.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_engine.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index ae726d7af9a..88fd823bc72 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -494,12 +494,7 @@ static void eevee_render_to_image(void *vedata, /* Previous motion step. */ if (do_motion_blur_fx) { - if (i > 0) { - /* The previous step of this iteration N is exactly the next step of iteration N - 1. - * So we just swap the resources to avoid too much re-evaluation. */ - EEVEE_motion_blur_swap_data(vedata); - } - else { + if (i == 0) { EEVEE_motion_blur_step_set(ved, MB_PREV); DRW_render_set_time(engine, depsgraph, floorf(time_prev), fractf(time_prev)); EEVEE_render_modules_init(vedata, engine, depsgraph); @@ -561,6 +556,11 @@ static void eevee_render_to_image(void *vedata, EEVEE_renderpasses_output_init( sldata, vedata, g_data->render_sample_count_per_timestep * time_steps_tot); + if (scene->world) { + /* Update world in case of animated world material. */ + eevee_id_world_update(vedata, scene->world); + } + EEVEE_temporal_sampling_create_view(vedata); EEVEE_render_draw(vedata, engine, render_layer, rect); @@ -570,6 +570,14 @@ static void eevee_render_to_image(void *vedata, DRW_cache_restart(); } } + + if (do_motion_blur_fx) { + /* The previous step of next iteration N is exactly the next step of this iteration N - 1. + * So we just swap the resources to avoid too much re-evaluation. + * Note that this also clears the VBO references from the GPUBatches of deformed + * geometries. */ + EEVEE_motion_blur_swap_data(vedata); + } } EEVEE_volumes_free_smoke_textures(); |