diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-06-10 19:34:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-06-22 14:28:01 +0300 |
commit | fed101a7be119f2e0c4ed64d13fd65f7a1c16118 (patch) | |
tree | 37ecf96cc6d2a82119de1879b998de0ec494e643 /intern/cycles/kernel/geom/geom_curve_intersect.h | |
parent | c7d940278b16bb357a848f176d070e1784ccdde2 (diff) |
Cycles: always perform backface culling for curve, remove option
The hair BSDFs are already designed to assume this, and disabling backface
culling would break them in some cases.
Ref T73778
Depends on D8009
Maniphest Tasks: T73778
Differential Revision: https://developer.blender.org/D8010
Diffstat (limited to 'intern/cycles/kernel/geom/geom_curve_intersect.h')
-rw-r--r-- | intern/cycles/kernel/geom/geom_curve_intersect.h | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/intern/cycles/kernel/geom/geom_curve_intersect.h b/intern/cycles/kernel/geom/geom_curve_intersect.h index 971f194a7dd..402b4f73597 100644 --- a/intern/cycles/kernel/geom/geom_curve_intersect.h +++ b/intern/cycles/kernel/geom/geom_curve_intersect.h @@ -27,14 +27,14 @@ ccl_device_inline ssef transform_point_T3(const ssef t[3], const ssef &a) /* On CPU pass P and dir by reference to aligned vector. */ ccl_device_forceinline bool curve_intersect(KernelGlobals *kg, - Intersection *isect, - const float3 ccl_ref P, - const float3 ccl_ref dir, - uint visibility, - int object, - int curveAddr, - float time, - int type) + Intersection *isect, + const float3 ccl_ref P, + const float3 ccl_ref dir, + uint visibility, + int object, + int curveAddr, + float time, + int type) { const bool is_curve_primitive = (type & PRIMITIVE_CURVE); @@ -82,8 +82,7 @@ ccl_device_forceinline bool curve_intersect(KernelGlobals *kg, } else { int fobject = (object == OBJECT_NONE) ? kernel_tex_fetch(__prim_object, curveAddr) : object; - motion_curve_keys_avx( - kg, fobject, prim, time, ka, k0, k1, kb, &P_curve_0_1, &P_curve_2_3); + motion_curve_keys_avx(kg, fobject, prim, time, ka, k0, k1, kb, &P_curve_0_1, &P_curve_2_3); } # else /* __KERNEL_AVX2__ */ ssef P_curve[4]; @@ -217,8 +216,7 @@ ccl_device_forceinline bool curve_intersect(KernelGlobals *kg, float r_curr = max(r_st, r_en); - if ((flags & CURVE_KN_RIBBONS) || !(flags & CURVE_KN_BACKFACING)) - epsilon = 2 * r_curr; + epsilon = 2 * r_curr; /* find bounds - this is slow for cubic curves */ float upper, lower; @@ -439,13 +437,6 @@ ccl_device_forceinline bool curve_intersect(KernelGlobals *kg, if (dot(tg, dp_en) < 0) dp_en *= -1; - if (flags & CURVE_KN_BACKFACING && - (dot(dp_st, -p_st) + t * dp_st.z < 0 || dot(dp_en, p_en) - t * dp_en.z < 0 || - isect->t < t || t <= 0.0f)) { - correction = (-tb + rootd) * 0.5f * invcyla; - t = tcentre + correction; - } - if (dot(dp_st, -p_st) + t * dp_st.z < 0 || dot(dp_en, p_en) - t * dp_en.z < 0 || isect->t < t || t <= 0.0f) { tree++; |