diff options
4 files changed, 20 insertions, 6 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index 79c60ba26d4..152c4a595d0 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -191,6 +191,8 @@ static void eevee_draw_background(void *vedata) { BLI_halton_3D(primes, offset, stl->effects->taa_current_sample, r); EEVEE_update_noise(psl, fbl, r); + + EEVEE_volumes_set_jitter(sldata, stl->effects->taa_current_sample - 1); } /* Refresh Probes */ diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index 318d44fabbf..54da57c7a87 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -858,6 +858,7 @@ void EEVEE_temporal_sampling_free(void); /* eevee_volumes.c */ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata); +void EEVEE_volumes_set_jitter(EEVEE_ViewLayerData *sldata, unsigned int current_sample); void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata); void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, struct Scene *scene, Object *ob); void EEVEE_volumes_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata); diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index 7a82f926614..51e8fa241d0 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -391,6 +391,7 @@ void EEVEE_render_draw(EEVEE_Data *vedata, struct RenderEngine *engine, struct D BLI_halton_3D(primes, offset, stl->effects->taa_current_sample, r); EEVEE_update_noise(psl, fbl, r); EEVEE_temporal_sampling_matrices_calc(stl->effects, g_data->viewmat, g_data->persmat, r); + EEVEE_volumes_set_jitter(sldata, stl->effects->taa_current_sample - 1); /* Refresh Probes */ EEVEE_lightprobes_refresh(sldata, vedata); diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index b97c091bd43..3c538c945e8 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -128,6 +128,21 @@ static void eevee_create_shader_volumes(void) e_data.volumetric_common_lib, NULL); } +void EEVEE_volumes_set_jitter(EEVEE_ViewLayerData *sldata, unsigned int current_sample) +{ + EEVEE_CommonUniformBuffer *common_data = &sldata->common_data; + + double ht_point[3]; + double ht_offset[3] = {0.0, 0.0}; + unsigned int ht_primes[3] = {3, 7, 2}; + + BLI_halton_3D(ht_primes, ht_offset, current_sample, ht_point); + + common_data->vol_jitter[0] = (float)ht_point[0]; + common_data->vol_jitter[1] = (float)ht_point[1]; + common_data->vol_jitter[2] = (float)ht_point[2]; +} + int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) { EEVEE_StorageList *stl = vedata->stl; @@ -223,8 +238,6 @@ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } /* Temporal Super sampling jitter */ - double ht_point[3]; - double ht_offset[3] = {0.0, 0.0}; unsigned int ht_primes[3] = {3, 7, 2}; unsigned int current_sample = 0; @@ -248,11 +261,8 @@ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) DRW_viewport_request_redraw(); } } - BLI_halton_3D(ht_primes, ht_offset, current_sample, ht_point); - common_data->vol_jitter[0] = (float)ht_point[0]; - common_data->vol_jitter[1] = (float)ht_point[1]; - common_data->vol_jitter[2] = (float)ht_point[2]; + EEVEE_volumes_set_jitter(sldata, current_sample); /* Framebuffer setup */ DRWFboTexture tex_vol[4] = {{&txl->volume_prop_scattering, DRW_TEX_RGB_11_11_10, DRW_TEX_FILTER}, |