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.
This commit is contained in:
Sergey Sharybin
2017-03-23 17:59:34 +01:00
parent 27248c8636
commit a96110e710

View File

@@ -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,