diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-23 19:59:34 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-23 19:59:34 +0300 |
commit | a96110e7102d7a54127994b81c8c049f6e5fdeea (patch) | |
tree | d44787fa4e8c57b2ef64ef6788f98d7669240fda | |
parent | 27248c8636ab8a6fa1e082ce9bc9bbdb09174358 (diff) |
Cycles: Remove old non-optimized triangle intersection function
It is unused now and if we want similar function we should use
Pluecker intersection which is same performance with SSE optimization
but which is more watertight.
-rw-r--r-- | intern/cycles/util/util_math_intersect.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/intern/cycles/util/util_math_intersect.h b/intern/cycles/util/util_math_intersect.h index 5bd3a52dcea..9e0587e1afb 100644 --- a/intern/cycles/util/util_math_intersect.h +++ b/intern/cycles/util/util_math_intersect.h @@ -290,49 +290,6 @@ ccl_device_forceinline bool ray_triangle_intersect( #undef IDX -ccl_device_inline bool ray_triangle_intersect_uv( - float3 ray_P, float3 ray_D, float ray_t, - float3 v0, float3 v1, float3 v2, - float *isect_u, float *isect_v, float *isect_t) -{ - /* Calculate intersection. */ - const float3 e1 = v1 - v0; - const float3 e2 = v2 - v0; - const float3 s1 = cross(ray_D, e2); - - const float divisor = dot(s1, e1); - if(UNLIKELY(divisor == 0.0f)) { - return false; - } - const float inv_divisor = 1.0f/divisor; - - /* Compute first barycentric coordinate. */ - const float3 d = ray_P - v0; - const float u = dot(d, s1)*inv_divisor; - if(u < 0.0f) { - return false; - } - /* Compute second barycentric coordinate. */ - const float3 s2 = cross(d, e1); - const float v = dot(ray_D, s2)*inv_divisor; - if(v < 0.0f) { - return false; - } - const float b0 = 1.0f - u - v; - if(b0 < 0.0f) { - return false; - } - /* Compute distance to intersection point. */ - const float t = dot(e2, s2)*inv_divisor; - if(t < 0.0f || t > ray_t) { - return false; - } - *isect_u = u; - *isect_v = v; - *isect_t = t; - return true; -} - ccl_device bool ray_quad_intersect(float3 ray_P, float3 ray_D, float ray_mint, float ray_maxt, float3 quad_P, |