diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-09-04 16:33:50 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-09-04 18:06:31 +0300 |
commit | 713ce037ab7738535ce05075b8b83ce08c0a9b9c (patch) | |
tree | 46fe14a42c79882d30f9bf3cdfc46c9a95d39227 /intern | |
parent | 65a80708d4ca0d28a9c6e35bf7429693b806e0b4 (diff) |
Cycles: Fix wrong check for zero-sized triangles
Initial idea was to optimize calculation a bit by skipping calculation of actual
triangle edges and use vector from ray origin to triangles. In practice this
optimization didn't quite work in cases when origin point is too close to the
triangle.
Let's do 2.76 with a bit more complicated calculation, still looking into exact
reasons why watertight intersections fails in certain cases, but actual fix might
bit be ready so soon.
This fixes wrong eyes on the lady from T46013.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/geom/geom_triangle_intersect.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h b/intern/cycles/kernel/geom/geom_triangle_intersect.h index 88038667909..c30c71bbf1a 100644 --- a/intern/cycles/kernel/geom/geom_triangle_intersect.h +++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h @@ -173,7 +173,7 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg, if(kernel_tex_fetch(__prim_visibility, triAddr) & visibility) #endif { - if(len_squared(cross(A, B)) < 1e-12f) { + if(len_squared(cross(tri_b - tri_a, tri_c - tri_a)) < 1e-16f) { return false; } /* Normalize U, V, W, and T. */ |