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>2011-12-13 04:00:26 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-12-13 04:00:26 +0400
commit57a39c3a0c2d8e0c7fd714c5046e9b8c65f67fc3 (patch)
treed30f9433a79cda13f918d28fb7799869e5654bb4 /intern/cycles/util
parent9e01abf7779a9272530d392767bdf9630544d519 (diff)
Fix #29594: cycles NaN values with window coordinates mapping.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_transform.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index 8f4e2b46616..4bf3759dd75 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -41,8 +41,9 @@ __device_inline float3 transform(const Transform *t, const float3 a)
{
float4 b = make_float4(a.x, a.y, a.z, 1.0f);
float3 c = make_float3(dot(t->x, b), dot(t->y, b), dot(t->z, b));
+ float w = dot(t->w, b);
- return c/dot(t->w, b);
+ return (w != 0.0f)? c/w: make_float3(0.0f, 0.0f, 0.0f);
}
__device_inline float3 transform_direction(const Transform *t, const float3 a)