Fix: EEVEE-Next: Velocity do_deform detection

In image renders, after the first motion blur step,
non deformed geometry was being marked as deformed,
since all their geometry lengths are 0.

This caused velocity_local_pos_get to read wrong/unitialized values.
This commit is contained in:
Miguel Pozo 2023-09-11 19:16:32 +02:00
parent ee1ee584de
commit efb74555fd
1 changed files with 3 additions and 2 deletions

View File

@ -344,8 +344,9 @@ void VelocityModule::end_sync()
(vel.geo.len[STEP_PREVIOUS] == GPU_vertbuf_get_vertex_len(pos_buf));
}
else {
vel.geo.do_deform = (vel.geo.len[STEP_PREVIOUS] == vel.geo.len[STEP_CURRENT]) &&
(vel.geo.len[STEP_NEXT] == vel.geo.len[STEP_CURRENT]);
vel.geo.do_deform = (vel.geo.len[STEP_CURRENT] != 0) &&
(vel.geo.len[STEP_CURRENT] == vel.geo.len[STEP_PREVIOUS]) &&
(vel.geo.len[STEP_CURRENT] == vel.geo.len[STEP_NEXT]);
}
indirection_buf[vel.obj.resource_id] = vel;
/* Reset for next sync. */