diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-23 14:59:55 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-23 15:04:41 +0300 |
commit | 439b40e601f8cdae9a12fc3f503e9e6acdd596d5 (patch) | |
tree | 9a485ec18d1c9dd030ffdfe9309193adc96dc515 /source/blender/draw/engines/eevee/eevee_materials.c | |
parent | cc3e808ab47887c002faaa8a28318a2b4f47e02a (diff) |
EEVEE: Motion Blur: Add accumulation motion blur for better precision
This revisit the render pipeline to support time slicing for better motion
blur.
We support accumulation with or without the Post-process motion blur.
If using the post-process, we reuse last step next motion data to avoid
another scene reevaluation.
This also adds support for hair motion blur which is handled in a similar
way as mesh motion blur.
The total number of samples is distributed evenly accross all timesteps to
avoid sampling weighting issues. For this reason, the sample count is
(internally) rounded up to the next multiple of the step count.
Only FX Motion BLur: {F8632258}
FX Motion Blur + 4 time steps: {F8632260}
FX Motion Blur + 32 time steps: {F8632261}
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D8079
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_materials.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index 06ed3764eaf..41c28075760 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -801,6 +801,8 @@ static void eevee_hair_cache_populate(EEVEE_Data *vedata, *matcache.shadow_grp_p = DRW_shgroup_hair_create_sub(ob, psys, md, matcache.shadow_grp); *cast_shadow = true; } + + EEVEE_motion_blur_hair_cache_populate(sldata, vedata, ob, psys, md); } #define ADD_SHGROUP_CALL(shgrp, ob, geom, oedata) \ @@ -949,17 +951,15 @@ void EEVEE_object_hair_cache_populate(EEVEE_Data *vedata, eevee_hair_cache_populate(vedata, sldata, ob, NULL, NULL, HAIR_MATERIAL_NR, cast_shadow); } -void EEVEE_materials_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) +void EEVEE_materials_cache_finish(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata) { EEVEE_PrivateData *pd = vedata->stl->g_data; EEVEE_EffectsInfo *effects = vedata->stl->effects; BLI_ghash_free(pd->material_hash, NULL, NULL); + pd->material_hash = NULL; SET_FLAG_FROM_TEST(effects->enabled_effects, effects->sss_surface_count > 0, EFFECT_SSS); - - /* TODO(fclem) this is not really clean. Init should not be done in cache finish. */ - EEVEE_subsurface_draw_init(sldata, vedata); } void EEVEE_materials_free(void) |