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-11-29 17:07:45 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-29 17:07:45 +0400
commit186bdbd8d8543f7cb610e17e2487f7ca28a2663b (patch)
treec79315a79e5e3e75ea72d90ebd8ba7afb8e5521c /intern/cycles/util/util_transform.h
parentd387dcd1104ec822b19530ebca9b5347a0f31413 (diff)
Fix #33344: cycles motion blur was still crashing on CUDA sm 2.0. Solution now
is also an optimization, use quaternion nlerp instead of slerp, there's no good reason to use slerp, and nlerp is faster too.
Diffstat (limited to 'intern/cycles/util/util_transform.h')
-rw-r--r--intern/cycles/util/util_transform.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index dbf88cb67a0..a1c12ddf0e1 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -311,6 +311,10 @@ __device_inline Transform transform_clear_scale(const Transform& tfm)
__device_inline float4 quat_interpolate(float4 q1, float4 q2, float t)
{
+ /* use simpe nlerp instead of slerp. it's faster and almost the same */
+ return normalize((1.0f - t)*q1 + t*q2);
+
+#if 0
/* note: this does not ensure rotation around shortest angle, q1 and q2
* are assumed to be matched already in transform_motion_decompose */
float costheta = dot(q1, q2);
@@ -328,6 +332,7 @@ __device_inline float4 quat_interpolate(float4 q1, float4 q2, float t)
float thetap = theta * t;
return q1 * cosf(thetap) + qperp * sinf(thetap);
}
+#endif
}
__device_inline Transform transform_quick_inverse(Transform M)