Fix T66529: Cycles motion blur render errors with fast rotating objects

In transform_motion_decompose, successive quaternion pairs are checked to be
aligned such that their interpolation is rotation through the shortest angle
between them. If not, the first in the pair was flipped. This can cause
problems for sequences of more than 2 quarternions, since flipping the first
in a pair might misalign the previously pair, if unlucky.

Instead, this change flips the second in the pair, which is safe when
iterating forwards.

Differential Revision: https://developer.blender.org/D6537
This commit is contained in:
Josh Belanich 2020-01-08 17:01:32 +01:00 committed by Brecht Van Lommel
parent 6bca11a847
commit e72ecaa371
Notes: blender-bot 2023-02-14 09:02:40 +01:00
Referenced by issue #66529, [Cycles] Motion Blur of fast rotating objects "randomly" glitches
Referenced by issue #62655, Cycles Motion Blur 'explodes'
1 changed files with 1 additions and 1 deletions

View File

@ -271,7 +271,7 @@ void transform_motion_decompose(DecomposedTransform *decomp, const Transform *mo
/* Ensure rotation around shortest angle, negated quaternions are the same
* but this means we don't have to do the check in quat_interpolate */
if (dot(decomp[i - 1].x, decomp[i].x) < 0.0f)
decomp[i - 1].x = -decomp[i - 1].x;
decomp[i].x = -decomp[i].x;
}
}
}