[Bf-blender-cvs] [a737ca11e12] eevee-motionblur-object: EEVEE: Motion Blur: Fix issues with animated objects visibility

Clément Foucault noreply at git.blender.org
Fri Jun 12 15:17:33 CEST 2020


Commit: a737ca11e1289c9143410562a14988839e8bb24e
Author: Clément Foucault
Date:   Fri Jun 12 14:21:17 2020 +0200
Branches: eevee-motionblur-object
https://developer.blender.org/rBa737ca11e1289c9143410562a14988839e8bb24e

EEVEE: Motion Blur: Fix issues with animated objects visibility

===================================================================

M	source/blender/draw/engines/eevee/eevee_motion_blur.c

===================================================================

diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.c b/source/blender/draw/engines/eevee/eevee_motion_blur.c
index e5c398ce87b..420efd4cedb 100644
--- a/source/blender/draw/engines/eevee/eevee_motion_blur.c
+++ b/source/blender/draw/engines/eevee/eevee_motion_blur.c
@@ -328,9 +328,9 @@ void EEVEE_motion_blur_cache_populate(EEVEE_ViewLayerData *UNUSED(sldata),
     return;
   }
 
+  const bool is_dupli = (ob->base_flag & BASE_FROM_DUPLI) != 0;
   /* For now we assume dupli objects are moving. */
-  const bool object_moves = (ob->base_flag & BASE_FROM_DUPLI) ||
-                            BKE_object_moves_in_time(ob, true);
+  const bool object_moves = is_dupli || BKE_object_moves_in_time(ob, true);
   const bool is_deform = BKE_object_is_deform_modified(DRW_context_state_get()->scene, ob);
 
   if (!(object_moves || is_deform)) {
@@ -353,6 +353,14 @@ void EEVEE_motion_blur_cache_populate(EEVEE_ViewLayerData *UNUSED(sldata),
         return;
       }
 
+      /* Fill missing matrices if the object was hidden in previous or next frame. */
+      if (is_zero_m4(mb_data->obmat[MB_PREV])) {
+        copy_m4_m4(mb_data->obmat[MB_PREV], mb_data->obmat[MB_CURR]);
+      }
+      if (is_zero_m4(mb_data->obmat[MB_NEXT])) {
+        copy_m4_m4(mb_data->obmat[MB_NEXT], mb_data->obmat[MB_CURR]);
+      }
+
       grp = DRW_shgroup_create(e_data.motion_blur_object_sh, psl->velocity_object);
       DRW_shgroup_uniform_mat4(grp, "prevModelMatrix", mb_data->obmat[MB_PREV]);
       DRW_shgroup_uniform_mat4(grp, "currModelMatrix", mb_data->obmat[MB_CURR]);



More information about the Bf-blender-cvs mailing list