Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-10-15 21:56:40 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-10-15 21:56:40 +0400
commitc10c6b1cea90fd863f56606adb87ab0261e03140 (patch)
tree36dd9232be4444c5cbb4223888083c44cc10c529 /intern/cycles/util
parent45d6eb5dea6d865ff25e807535a5175a920b33fb (diff)
Fix #32844: cycles camera motion blur producing completely blurred frames sometimes.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_transform.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index d93bbff5415..3d6aefed56d 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -304,10 +304,18 @@ __device_inline float4 quat_interpolate(float4 q1, float4 q2, float t)
{
float costheta = dot(q1, q2);
+ /* rotate around shortest angle */
+ if(costheta < 0.0f) {
+ costheta = -costheta;
+ q1 = -q1;
+ }
+
if(costheta > 0.9995f) {
+ /* linear interpolation in degenerate case */
return normalize((1.0f - t)*q1 + t*q2);
}
else {
+ /* slerp */
float theta = acosf(clamp(costheta, -1.0f, 1.0f));
float thetap = theta * t;
float4 qperp = normalize(q2 - q1 * costheta);