Cycles: Make SSS intersection closer to regular triangle intersection

This commit is contained in:
Sergey Sharybin 2015-04-01 21:19:29 +05:00
parent 394b947a50
commit f1494edf78

@ -247,13 +247,10 @@ ccl_device_inline void triangle_intersect_subsurface(
/* Calculate scaled zcoordinates of vertices and use them to calculate /* Calculate scaled zcoordinates of vertices and use them to calculate
* the hit distance. * the hit distance.
*/ */
const float Az = Sz * A_kz; const float T = (U * A_kz + V * B_kz + W * C_kz) * Sz;
const float Bz = Sz * B_kz; const float sign_T = xor_signmast(T, sign_mask);
const float Cz = Sz * C_kz; if((sign_T < 0.0f) ||
const float T = U * Az + V * Bz + W * Cz; (sign_T > tmax * xor_signmast(det, sign_mask)))
if((xor_signmast(T, sign_mask) < 0.0f) ||
(xor_signmast(T, sign_mask) > tmax * xor_signmast(det, sign_mask)))
{ {
return; return;
} }