Cycles: Simplify check for degenerated faces on GPU

Still not sure how to properly solve the issue, needs some trickery to get
actual optimized values from intersection function (using printf() avoids
some optimization and makes stuff render correct).

For the time being let's just simplify check.
This commit is contained in:
Sergey Sharybin 2016-06-03 10:34:21 +02:00
parent e370806b38
commit f54a98a1c5

@ -160,15 +160,10 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg,
#endif
{
#ifdef __KERNEL_GPU__
float4 a = tri_b - tri_a, b = tri_c - tri_a;
if(len_squared(make_float3(a.y*b.z - a.z*b.y,
a.z*b.x - a.x*b.z,
a.x*b.y - a.y*b.x)) == 0.0f)
{
if(A == B && B == C) {
return false;
}
#endif
/* Normalize U, V, W, and T. */
const float inv_det = 1.0f / det;
isect->prim = triAddr;