[Bf-blender-cvs] [a96110e710] master: Cycles: Remove old non-optimized triangle intersection function

Sergey Sharybin noreply at git.blender.org
Thu Mar 23 18:05:24 CET 2017


Commit: a96110e7102d7a54127994b81c8c049f6e5fdeea
Author: Sergey Sharybin
Date:   Thu Mar 23 17:59:34 2017 +0100
Branches: master
https://developer.blender.org/rBa96110e7102d7a54127994b81c8c049f6e5fdeea

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.

===================================================================

M	intern/cycles/util/util_math_intersect.h

===================================================================

diff --git a/intern/cycles/util/util_math_intersect.h b/intern/cycles/util/util_math_intersect.h
index 5bd3a52dce..9e0587e1af 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,




More information about the Bf-blender-cvs mailing list