diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-04-01 19:19:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-04-01 19:20:04 +0300 |
commit | f1494edf787099d9261f7ab82a66c68ffbe8e727 (patch) | |
tree | b0d0f878ab575ee426337bbf8a39aa553a880bd0 /intern | |
parent | 394b947a500db59b753e39841057e3f0c5422bbc (diff) |
Cycles: Make SSS intersection closer to regular triangle intersection
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/geom/geom_triangle_intersect.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h b/intern/cycles/kernel/geom/geom_triangle_intersect.h index d3919a05396..b29fc2b4e9d 100644 --- a/intern/cycles/kernel/geom/geom_triangle_intersect.h +++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h @@ -247,13 +247,10 @@ ccl_device_inline void triangle_intersect_subsurface( /* Calculate scaled z−coordinates of vertices and use them to calculate * the hit distance. */ - const float Az = Sz * A_kz; - const float Bz = Sz * B_kz; - const float Cz = Sz * C_kz; - const float T = U * Az + V * Bz + W * Cz; - - if((xor_signmast(T, sign_mask) < 0.0f) || - (xor_signmast(T, sign_mask) > tmax * xor_signmast(det, sign_mask))) + const float T = (U * A_kz + V * B_kz + W * C_kz) * Sz; + const float sign_T = xor_signmast(T, sign_mask); + if((sign_T < 0.0f) || + (sign_T > tmax * xor_signmast(det, sign_mask))) { return; } |