diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-16 12:35:21 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-16 12:35:21 +0400 |
commit | 93df58160e56f81bb588a7df6a3a3d3d77365ce5 (patch) | |
tree | f53e6d8a7d2c7270f2ae3d53bd2d5f8ec5872153 /intern/cycles/util/util_transform.h | |
parent | 9cf2e5baf64a927325efeba5ed20c20dfec3da57 (diff) |
Fix #30966: cycles nan mesh vertices got set to (0, 0, 0), now remove them instead.
Diffstat (limited to 'intern/cycles/util/util_transform.h')
-rw-r--r-- | intern/cycles/util/util_transform.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h index 07db52f6392..aeaef7b0e21 100644 --- a/intern/cycles/util/util_transform.h +++ b/intern/cycles/util/util_transform.h @@ -37,7 +37,7 @@ typedef struct Transform { #endif } Transform; -__device_inline float3 transform(const Transform *t, const float3 a) +__device_inline float3 transform_perspective(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)); @@ -46,6 +46,14 @@ __device_inline float3 transform(const Transform *t, const float3 a) return (w != 0.0f)? c/w: make_float3(0.0f, 0.0f, 0.0f); } +__device_inline float3 transform_point(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)); + + return c; +} + __device_inline float3 transform_direction(const Transform *t, const float3 a) { float4 b = make_float4(a.x, a.y, a.z, 0.0f); |