Cycles: remove hair minimum width support.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 16 Mar 2019 21:05:37 +0000 (22:05 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 24 Apr 2019 12:39:47 +0000 (14:39 +0200)
This never really worked as it was supposed to. The main goal of this is to
turn noise from sampling tiny hairs into multiple layers of transparency that
do not need to be sampled stochastically. However the implementation of this
worked by randomly discarding hair intersections in BVH traversal, which
defeats the purpose.

If it ever comes back, it's best implemented outside the kernel as a preprocess
that changes hair radius before BVH building. This would also make it work with
Embree, where it's not supported now. But it's not so clear anymore that with
many AA samples and GPU rendering this feature is as helpful as it once was for
CPU raytracers with few AA samples.

The benefit of removing this feature is improved hair ray tracing performance,
tested on NVIDIA Titan Xp:

bmw27: +0.37%
classroom: +0.26%
fishy_cat: -7.36%
koro: -12.98%
pabellon: -0.12%

Differential Revision: https://developer.blender.org/D4532

22 files changed:
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_curves.cpp
intern/cycles/kernel/bvh/bvh.h
intern/cycles/kernel/bvh/bvh_nodes.h
intern/cycles/kernel/bvh/bvh_shadow_all.h
intern/cycles/kernel/bvh/bvh_traversal.h
intern/cycles/kernel/bvh/bvh_types.h
intern/cycles/kernel/bvh/obvh_nodes.h
intern/cycles/kernel/bvh/obvh_shadow_all.h
intern/cycles/kernel/bvh/obvh_traversal.h
intern/cycles/kernel/bvh/qbvh_nodes.h
intern/cycles/kernel/bvh/qbvh_shadow_all.h
intern/cycles/kernel/bvh/qbvh_traversal.h
intern/cycles/kernel/geom/geom_curve_intersect.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_shadow.h
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/svm/svm_ao.h
intern/cycles/render/curves.cpp
intern/cycles/render/curves.h

index ae07bcd38fef409f39736071752ebc0b373c8472..d6242fc3f7c0a4b7253adf55acae8bbdf652b9c6 100644 (file)
@@ -1192,20 +1192,6 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
         min=3, max=64,
         default=3,
     )
-    minimum_width: FloatProperty(
-        name="Minimal width",
-        description="Minimal pixel width for strands (0 - deactivated)",
-        min=0.0, max=100.0,
-        default=0.0,
-        subtype='PIXEL'
-    )
-    maximum_width: FloatProperty(
-        name="Maximal width",
-        description="Maximum extension that strand radius can be increased by",
-        min=0.0, max=100.0,
-        default=0.1,
-        subtype='PIXEL'
-    )
     subdivisions: IntProperty(
         name="Subdivisions",
         description="Number of subdivisions used in Cardinal curve intersection (power of 2)",
index 16ad3716d4b92fc0e377a528bd396edd51bdb13b..bcf9a3517588c09988feedc37ac50a522ac62c4a 100644 (file)
@@ -358,8 +358,6 @@ class CYCLES_RENDER_PT_hair(CyclesButtonsPanel, Panel):
         layout.active = ccscene.use_curves
 
         col = layout.column()
-        col.prop(ccscene, "minimum_width", text="Min Pixels")
-        col.prop(ccscene, "maximum_width", text="Max Extension")
         col.prop(ccscene, "shape", text="Shape")
         if not (ccscene.primitive in {'CURVE_SEGMENTS', 'LINE_SEGMENTS'} and ccscene.shape == 'RIBBONS'):
             col.prop(ccscene, "cull_backfacing", text="Cull back-faces")
index d0375ceb79c66a8d4aba1d1b9dc40aff1a65eff7..636b8e4248117ef72d57c021e96eb156eb439eaf 100644 (file)
@@ -897,8 +897,6 @@ void BlenderSync::sync_curve_settings()
   CurveSystemManager prev_curve_system_manager = *curve_system_manager;
 
   curve_system_manager->use_curves = get_boolean(csscene, "use_curves");
-  curve_system_manager->minimum_width = get_float(csscene, "minimum_width");
-  curve_system_manager->maximum_width = get_float(csscene, "maximum_width");
 
   curve_system_manager->primitive = (CurvePrimitiveType)get_enum(
       csscene, "primitive", CURVE_NUM_PRIMITIVE_TYPES, CURVE_LINE_SEGMENTS);
index 13e72ed299f8fbbf448fe80be9b89c3e1eb03b2c..7503bad37b076f0d98119b3c2cf953cf03c0111e 100644 (file)
@@ -57,7 +57,7 @@ CCL_NAMESPACE_BEGIN
 
 #if defined(__HAIR__)
 #  define BVH_FUNCTION_NAME bvh_intersect_hair
-#  define BVH_FUNCTION_FEATURES BVH_INSTANCING | BVH_HAIR | BVH_HAIR_MINIMUM_WIDTH
+#  define BVH_FUNCTION_FEATURES BVH_INSTANCING | BVH_HAIR
 #  include "kernel/bvh/bvh_traversal.h"
 #endif
 
@@ -69,7 +69,7 @@ CCL_NAMESPACE_BEGIN
 
 #if defined(__HAIR__) && defined(__OBJECT_MOTION__)
 #  define BVH_FUNCTION_NAME bvh_intersect_hair_motion
-#  define BVH_FUNCTION_FEATURES BVH_INSTANCING | BVH_HAIR | BVH_HAIR_MINIMUM_WIDTH | BVH_MOTION
+#  define BVH_FUNCTION_FEATURES BVH_INSTANCING | BVH_HAIR | BVH_MOTION
 #  include "kernel/bvh/bvh_traversal.h"
 #endif
 
@@ -181,10 +181,7 @@ ccl_device_inline bool scene_intersect_valid(const Ray *ray)
 ccl_device_intersect bool scene_intersect(KernelGlobals *kg,
                                           const Ray ray,
                                           const uint visibility,
-                                          Intersection *isect,
-                                          uint *lcg_state,
-                                          float difl,
-                                          float extmax)
+                                          Intersection *isect)
 {
   PROFILING_INIT(kg, PROFILING_INTERSECT);
 
@@ -211,7 +208,7 @@ ccl_device_intersect bool scene_intersect(KernelGlobals *kg,
   if (kernel_data.bvh.have_motion) {
 #  ifdef __HAIR__
     if (kernel_data.bvh.have_curves)
-      return bvh_intersect_hair_motion(kg, &ray, isect, visibility, lcg_state, difl, extmax);
+      return bvh_intersect_hair_motion(kg, &ray, isect, visibility);
 #  endif /* __HAIR__ */
 
     return bvh_intersect_motion(kg, &ray, isect, visibility);
@@ -220,7 +217,7 @@ ccl_device_intersect bool scene_intersect(KernelGlobals *kg,
 
 #ifdef __HAIR__
   if (kernel_data.bvh.have_curves)
-    return bvh_intersect_hair(kg, &ray, isect, visibility, lcg_state, difl, extmax);
+    return bvh_intersect_hair(kg, &ray, isect, visibility);
 #endif /* __HAIR__ */
 
 #ifdef __KERNEL_CPU__
index 042630121c8d905d5188986633b394653fabd4ef..a33bc73e25bfa2cb4b77d0f5c2d8ca3f71ebf6cd 100644 (file)
@@ -75,67 +75,6 @@ ccl_device_forceinline int bvh_aligned_node_intersect(KernelGlobals *kg,
 #  endif
 }
 
-ccl_device_forceinline int bvh_aligned_node_intersect_robust(KernelGlobals *kg,
-                                                             const float3 P,
-                                                             const float3 idir,
-                                                             const float t,
-                                                             const float difl,
-                                                             const float extmax,
-                                                             const int node_addr,
-                                                             const uint visibility,
-                                                             float dist[2])
-{
-
-  /* fetch node data */
-  float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr + 0);
-  float4 node0 = kernel_tex_fetch(__bvh_nodes, node_addr + 1);
-  float4 node1 = kernel_tex_fetch(__bvh_nodes, node_addr + 2);
-  float4 node2 = kernel_tex_fetch(__bvh_nodes, node_addr + 3);
-
-  /* intersect ray against child nodes */
-  float c0lox = (node0.x - P.x) * idir.x;
-  float c0hix = (node0.z - P.x) * idir.x;
-  float c0loy = (node1.x - P.y) * idir.y;
-  float c0hiy = (node1.z - P.y) * idir.y;
-  float c0loz = (node2.x - P.z) * idir.z;
-  float c0hiz = (node2.z - P.z) * idir.z;
-  float c0min = max4(0.0f, min(c0lox, c0hix), min(c0loy, c0hiy), min(c0loz, c0hiz));
-  float c0max = min4(t, max(c0lox, c0hix), max(c0loy, c0hiy), max(c0loz, c0hiz));
-
-  float c1lox = (node0.y - P.x) * idir.x;
-  float c1hix = (node0.w - P.x) * idir.x;
-  float c1loy = (node1.y - P.y) * idir.y;
-  float c1hiy = (node1.w - P.y) * idir.y;
-  float c1loz = (node2.y - P.z) * idir.z;
-  float c1hiz = (node2.w - P.z) * idir.z;
-  float c1min = max4(0.0f, min(c1lox, c1hix), min(c1loy, c1hiy), min(c1loz, c1hiz));
-  float c1max = min4(t, max(c1lox, c1hix), max(c1loy, c1hiy), max(c1loz, c1hiz));
-
-  if (difl != 0.0f) {
-    float hdiff = 1.0f + difl;
-    float ldiff = 1.0f - difl;
-    if (__float_as_int(cnodes.z) & PATH_RAY_CURVE) {
-      c0min = max(ldiff * c0min, c0min - extmax);
-      c0max = min(hdiff * c0max, c0max + extmax);
-    }
-    if (__float_as_int(cnodes.w) & PATH_RAY_CURVE) {
-      c1min = max(ldiff * c1min, c1min - extmax);
-      c1max = min(hdiff * c1max, c1max + extmax);
-    }
-  }
-
-  dist[0] = c0min;
-  dist[1] = c1min;
-
-#  ifdef __VISIBILITY_FLAG__
-  /* this visibility test gives a 5% performance hit, how to solve? */
-  return (((c0max >= c0min) && (__float_as_uint(cnodes.x) & visibility)) ? 1 : 0) |
-         (((c1max >= c1min) && (__float_as_uint(cnodes.y) & visibility)) ? 2 : 0);
-#  else
-  return ((c0max >= c0min) ? 1 : 0) | ((c1max >= c1min) ? 2 : 0);
-#  endif
-}
-
 ccl_device_forceinline bool bvh_unaligned_node_intersect_child(KernelGlobals *kg,
                                                                const float3 P,
                                                                const float3 dir,
@@ -162,41 +101,6 @@ ccl_device_forceinline bool bvh_unaligned_node_intersect_child(KernelGlobals *kg
   return tnear <= tfar;
 }
 
-ccl_device_forceinline bool bvh_unaligned_node_intersect_child_robust(KernelGlobals *kg,
-                                                                      const float3 P,
-                                                                      const float3 dir,
-                                                                      const float t,
-                                                                      const float difl,
-                                                                      int node_addr,
-                                                                      int child,
-                                                                      float dist[2])
-{
-  Transform space = bvh_unaligned_node_fetch_space(kg, node_addr, child);
-  float3 aligned_dir = transform_direction(&space, dir);
-  float3 aligned_P = transform_point(&space, P);
-  float3 nrdir = -bvh_inverse_direction(aligned_dir);
-  float3 tLowerXYZ = aligned_P * nrdir;
-  float3 tUpperXYZ = tLowerXYZ - nrdir;
-  const float near_x = min(tLowerXYZ.x, tUpperXYZ.x);
-  const float near_y = min(tLowerXYZ.y, tUpperXYZ.y);
-  const float near_z = min(tLowerXYZ.z, tUpperXYZ.z);
-  const float far_x = max(tLowerXYZ.x, tUpperXYZ.x);
-  const float far_y = max(tLowerXYZ.y, tUpperXYZ.y);
-  const float far_z = max(tLowerXYZ.z, tUpperXYZ.z);
-  const float tnear = max4(0.0f, near_x, near_y, near_z);
-  const float tfar = min4(t, far_x, far_y, far_z);
-  *dist = tnear;
-  if (difl != 0.0f) {
-    /* TODO(sergey): Same as for QBVH, needs a proper use. */
-    const float round_down = 1.0f - difl;
-    const float round_up = 1.0f + difl;
-    return round_down * tnear <= round_up * tfar;
-  }
-  else {
-    return tnear <= tfar;
-  }
-}
-
 ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg,
                                                         const float3 P,
                                                         const float3 dir,
@@ -227,38 +131,6 @@ ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg,
   return mask;
 }
 
-ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg,
-                                                               const float3 P,
-                                                               const float3 dir,
-                                                               const float3 idir,
-                                                               const float t,
-                                                               const float difl,
-                                                               const float extmax,
-                                                               const int node_addr,
-                                                               const uint visibility,
-                                                               float dist[2])
-{
-  int mask = 0;
-  float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr + 0);
-  if (bvh_unaligned_node_intersect_child_robust(kg, P, dir, t, difl, node_addr, 0, &dist[0])) {
-#  ifdef __VISIBILITY_FLAG__
-    if ((__float_as_uint(cnodes.x) & visibility))
-#  endif
-    {
-      mask |= 1;
-    }
-  }
-  if (bvh_unaligned_node_intersect_child_robust(kg, P, dir, t, difl, node_addr, 1, &dist[1])) {
-#  ifdef __VISIBILITY_FLAG__
-    if ((__float_as_uint(cnodes.y) & visibility))
-#  endif
-    {
-      mask |= 2;
-    }
-  }
-  return mask;
-}
-
 ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg,
                                               const float3 P,
                                               const float3 dir,
@@ -277,27 +149,6 @@ ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg,
   }
 }
 
-ccl_device_forceinline int bvh_node_intersect_robust(KernelGlobals *kg,
-                                                     const float3 P,
-                                                     const float3 dir,
-                                                     const float3 idir,
-                                                     const float t,
-                                                     const float difl,
-                                                     const float extmax,
-                                                     const int node_addr,
-                                                     const uint visibility,
-                                                     float dist[2])
-{
-  float4 node = kernel_tex_fetch(__bvh_nodes, node_addr);
-  if (__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) {
-    return bvh_unaligned_node_intersect_robust(
-        kg, P, dir, idir, t, difl, extmax, node_addr, visibility, dist);
-  }
-  else {
-    return bvh_aligned_node_intersect_robust(
-        kg, P, idir, t, difl, extmax, node_addr, visibility, dist);
-  }
-}
 #else /* !defined(__KERNEL_SSE2__) */
 
 int ccl_device_forceinline bvh_aligned_node_intersect(KernelGlobals *kg,
@@ -343,69 +194,6 @@ int ccl_device_forceinline bvh_aligned_node_intersect(KernelGlobals *kg,
 #  endif
 }
 
-ccl_device_forceinline int bvh_aligned_node_intersect_robust(KernelGlobals *kg,
-                                                             const float3 &P,
-                                                             const float3 &dir,
-                                                             const ssef &tsplat,
-                                                             const ssef Psplat[3],
-                                                             const ssef idirsplat[3],
-                                                             const shuffle_swap_t shufflexyz[3],
-                                                             const float difl,
-                                                             const float extmax,
-                                                             const int nodeAddr,
-                                                             const uint visibility,
-                                                             float dist[2])
-{
-  /* Intersect two child bounding boxes, SSE3 version adapted from Embree */
-  const ssef pn = cast(ssei(0, 0, 0x80000000, 0x80000000));
-
-  /* fetch node data */
-  const ssef *bvh_nodes = (ssef *)kg->__bvh_nodes.data + nodeAddr;
-
-  /* intersect ray against child nodes */
-  const ssef tminmaxx = (shuffle_swap(bvh_nodes[1], shufflexyz[0]) - Psplat[0]) * idirsplat[0];
-  const ssef tminmaxy = (shuffle_swap(bvh_nodes[2], shufflexyz[1]) - Psplat[1]) * idirsplat[1];
-  const ssef tminmaxz = (shuffle_swap(bvh_nodes[3], shufflexyz[2]) - Psplat[2]) * idirsplat[2];
-
-  /* calculate { c0min, c1min, -c0max, -c1max} */
-  ssef minmax = max(max(tminmaxx, tminmaxy), max(tminmaxz, tsplat));
-  const ssef tminmax = minmax ^ pn;
-
-  if (difl != 0.0f) {
-    float4 cnodes = kernel_tex_fetch(__bvh_nodes, nodeAddr + 0);
-    float4 *tminmaxview = (float4 *)&tminmax;
-    float &c0min = tminmaxview->x, &c1min = tminmaxview->y;
-    float &c0max = tminmaxview->z, &c1max = tminmaxview->w;
-    float hdiff = 1.0f + difl;
-    float ldiff = 1.0f - difl;
-    if (__float_as_int(cnodes.x) & PATH_RAY_CURVE) {
-      c0min = max(ldiff * c0min, c0min - extmax);
-      c0max = min(hdiff * c0max, c0max + extmax);
-    }
-    if (__float_as_int(cnodes.y) & PATH_RAY_CURVE) {
-      c1min = max(ldiff * c1min, c1min - extmax);
-      c1max = min(hdiff * c1max, c1max + extmax);
-    }
-  }
-
-  const sseb lrhit = tminmax <= shuffle<2, 3, 0, 1>(tminmax);
-
-  dist[0] = tminmax[0];
-  dist[1] = tminmax[1];
-
-  int mask = movemask(lrhit);
-
-#  ifdef __VISIBILITY_FLAG__
-  /* this visibility test gives a 5% performance hit, how to solve? */
-  float4 cnodes = kernel_tex_fetch(__bvh_nodes, nodeAddr + 0);
-  int cmask = (((mask & 1) && (__float_as_uint(cnodes.x) & visibility)) ? 1 : 0) |
-              (((mask & 2) && (__float_as_uint(cnodes.y) & visibility)) ? 2 : 0);
-  return cmask;
-#  else
-  return mask & 3;
-#  endif
-}
-
 ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg,
                                                         const float3 P,
                                                         const float3 dir,
@@ -458,68 +246,6 @@ ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg,
 #  endif
 }
 
-ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg,
-                                                               const float3 P,
-                                                               const float3 dir,
-                                                               const ssef &isect_near,
-                                                               const ssef &isect_far,
-                                                               const float difl,
-                                                               const int node_addr,
-                                                               const uint visibility,
-                                                               float dist[2])
-{
-  Transform space0 = bvh_unaligned_node_fetch_space(kg, node_addr, 0);
-  Transform space1 = bvh_unaligned_node_fetch_space(kg, node_addr, 1);
-
-  float3 aligned_dir0 = transform_direction(&space0, dir),
-         aligned_dir1 = transform_direction(&space1, dir);
-  float3 aligned_P0 = transform_point(&space0, P), aligned_P1 = transform_point(&space1, P);
-  float3 nrdir0 = -bvh_inverse_direction(aligned_dir0),
-         nrdir1 = -bvh_inverse_direction(aligned_dir1);
-
-  ssef lower_x = ssef(aligned_P0.x * nrdir0.x, aligned_P1.x * nrdir1.x, 0.0f, 0.0f),
-       lower_y = ssef(aligned_P0.y * nrdir0.y, aligned_P1.y * nrdir1.y, 0.0f, 0.0f),
-       lower_z = ssef(aligned_P0.z * nrdir0.z, aligned_P1.z * nrdir1.z, 0.0f, 0.0f);
-
-  ssef upper_x = lower_x - ssef(nrdir0.x, nrdir1.x, 0.0f, 0.0f),
-       upper_y = lower_y - ssef(nrdir0.y, nrdir1.y, 0.0f, 0.0f),
-       upper_z = lower_z - ssef(nrdir0.z, nrdir1.z, 0.0f, 0.0f);
-
-  ssef tnear_x = min(lower_x, upper_x);
-  ssef tnear_y = min(lower_y, upper_y);
-  ssef tnear_z = min(lower_z, upper_z);
-  ssef tfar_x = max(lower_x, upper_x);
-  ssef tfar_y = max(lower_y, upper_y);
-  ssef tfar_z = max(lower_z, upper_z);
-
-  const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z);
-  const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z);
-  sseb vmask;
-  if (difl != 0.0f) {
-    const float round_down = 1.0f - difl;
-    const float round_up = 1.0f + difl;
-    vmask = round_down * tnear <= round_up * tfar;
-  }
-  else {
-    vmask = tnear <= tfar;
-  }
-
-  dist[0] = tnear.f[0];
-  dist[1] = tnear.f[1];
-
-  int mask = (int)movemask(vmask);
-
-#  ifdef __VISIBILITY_FLAG__
-  /* this visibility test gives a 5% performance hit, how to solve? */
-  float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr + 0);
-  int cmask = (((mask & 1) && (__float_as_uint(cnodes.x) & visibility)) ? 1 : 0) |
-              (((mask & 2) && (__float_as_uint(cnodes.y) & visibility)) ? 2 : 0);
-  return cmask;
-#  else
-  return mask & 3;
-#  endif
-}
-
 ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg,
                                               const float3 &P,
                                               const float3 &dir,
@@ -543,40 +269,4 @@ ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg,
         kg, P, dir, tsplat, Psplat, idirsplat, shufflexyz, node_addr, visibility, dist);
   }
 }
-
-ccl_device_forceinline int bvh_node_intersect_robust(KernelGlobals *kg,
-                                                     const float3 &P,
-                                                     const float3 &dir,
-                                                     const ssef &isect_near,
-                                                     const ssef &isect_far,
-                                                     const ssef &tsplat,
-                                                     const ssef Psplat[3],
-                                                     const ssef idirsplat[3],
-                                                     const shuffle_swap_t shufflexyz[3],
-                                                     const float difl,
-                                                     const float extmax,
-                                                     const int node_addr,
-                                                     const uint visibility,
-                                                     float dist[2])
-{
-  float4 node = kernel_tex_fetch(__bvh_nodes, node_addr);
-  if (__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) {
-    return bvh_unaligned_node_intersect_robust(
-        kg, P, dir, isect_near, isect_far, difl, node_addr, visibility, dist);
-  }
-  else {
-    return bvh_aligned_node_intersect_robust(kg,
-                                             P,
-                                             dir,
-                                             tsplat,
-                                             Psplat,
-                                             idirsplat,
-                                             shufflexyz,
-                                             difl,
-                                             extmax,
-                                             node_addr,
-                                             visibility,
-                                             dist);
-  }
-}
 #endif /* !defined(__KERNEL_SSE2__) */
index b362779549c89aec3c7713643991efa2554f5940..268bb149970b19698a3dbc75e033a79372be9629 100644 (file)
@@ -219,10 +219,7 @@ ccl_device_inline
                                                  object,
                                                  prim_addr,
                                                  ray->time,
-                                                 curve_type,
-                                                 NULL,
-                                                 0,
-                                                 0);
+                                                 curve_type);
                 }
                 else {
                   hit = curve_intersect(kg,
@@ -233,10 +230,7 @@ ccl_device_inline
                                         object,
                                         prim_addr,
                                         ray->time,
-                                        curve_type,
-                                        NULL,
-                                        0,
-                                        0);
+                                        curve_type);
                 }
                 break;
               }
index 34a06d003bb9a1410b55d3e21dafcf6257694424..18afc6ae4ebdd4f9eb2110c84c9f8e2845cf79da 100644 (file)
 
 #if BVH_FEATURE(BVH_HAIR)
 #  define NODE_INTERSECT bvh_node_intersect
-#  define NODE_INTERSECT_ROBUST bvh_node_intersect_robust
 #else
 #  define NODE_INTERSECT bvh_aligned_node_intersect
-#  define NODE_INTERSECT_ROBUST bvh_aligned_node_intersect_robust
 #endif
 
 /* This is a template BVH traversal function, where various features can be
  *
  * BVH_INSTANCING: object instancing
  * BVH_HAIR: hair curve rendering
- * BVH_HAIR_MINIMUM_WIDTH: hair curve rendering with minimum width
  * BVH_MOTION: motion blur rendering
  */
 
 ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
                                                      const Ray *ray,
                                                      Intersection *isect,
-                                                     const uint visibility
-#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-                                                     ,
-                                                     uint *lcg_state,
-                                                     float difl,
-                                                     float extmax
-#endif
-)
+                                                     const uint visibility)
 {
   /* todo:
    * - test if pushing distance on the stack helps (for non shadow rays)
@@ -117,23 +107,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
         float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr + 0);
 
 #if !defined(__KERNEL_SSE2__)
-#  if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-        if (difl != 0.0f) {
-          traverse_mask = NODE_INTERSECT_ROBUST(kg,
-                                                P,
-#    if BVH_FEATURE(BVH_HAIR)
-                                                dir,
-#    endif
-                                                idir,
-                                                isect->t,
-                                                difl,
-                                                extmax,
-                                                node_addr,
-                                                visibility,
-                                                dist);
-        }
-        else
-#  endif
         {
           traverse_mask = NODE_INTERSECT(kg,
                                          P,
@@ -147,27 +120,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
                                          dist);
         }
 #else  // __KERNEL_SSE2__
-#  if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-        if (difl != 0.0f) {
-          traverse_mask = NODE_INTERSECT_ROBUST(kg,
-                                                P,
-                                                dir,
-#    if BVH_FEATURE(BVH_HAIR)
-                                                tnear,
-                                                tfar,
-#    endif
-                                                tsplat,
-                                                Psplat,
-                                                idirsplat,
-                                                shufflexyz,
-                                                difl,
-                                                extmax,
-                                                node_addr,
-                                                visibility,
-                                                dist);
-        }
-        else
-#  endif
         {
           traverse_mask = NODE_INTERSECT(kg,
                                          P,
@@ -287,32 +239,12 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
                 kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL));
                 bool hit;
                 if (kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) {
-                  hit = cardinal_curve_intersect(kg,
-                                                 isect,
-                                                 P,
-                                                 dir,
-                                                 visibility,
-                                                 object,
-                                                 prim_addr,
-                                                 ray->time,
-                                                 curve_type,
-                                                 lcg_state,
-                                                 difl,
-                                                 extmax);
+                  hit = cardinal_curve_intersect(
+                      kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type);
                 }
                 else {
-                  hit = curve_intersect(kg,
-                                        isect,
-                                        P,
-                                        dir,
-                                        visibility,
-                                        object,
-                                        prim_addr,
-                                        ray->time,
-                                        curve_type,
-                                        lcg_state,
-                                        difl,
-                                        extmax);
+                  hit = curve_intersect(
+                      kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type);
                 }
                 if (hit) {
                   /* shadow ray early termination */
@@ -408,56 +340,19 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
 ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals *kg,
                                          const Ray *ray,
                                          Intersection *isect,
-                                         const uint visibility
-#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-                                         ,
-                                         uint *lcg_state,
-                                         float difl,
-                                         float extmax
-#endif
-)
+                                         const uint visibility)
 {
   switch (kernel_data.bvh.bvh_layout) {
 #ifdef __KERNEL_AVX2__
     case BVH_LAYOUT_BVH8:
-      return BVH_FUNCTION_FULL_NAME(OBVH)(kg,
-                                          ray,
-                                          isect,
-                                          visibility
-#  if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-                                          ,
-                                          lcg_state,
-                                          difl,
-                                          extmax
-#  endif
-      );
+      return BVH_FUNCTION_FULL_NAME(OBVH)(kg, ray, isect, visibility);
 #endif
 #ifdef __QBVH__
     case BVH_LAYOUT_BVH4:
-      return BVH_FUNCTION_FULL_NAME(QBVH)(kg,
-                                          ray,
-                                          isect,
-                                          visibility
-#  if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-                                          ,
-                                          lcg_state,
-                                          difl,
-                                          extmax
-#  endif
-      );
+      return BVH_FUNCTION_FULL_NAME(QBVH)(kg, ray, isect, visibility);
 #endif /* __QBVH__ */
     case BVH_LAYOUT_BVH2:
-      return BVH_FUNCTION_FULL_NAME(BVH)(kg,
-                                         ray,
-                                         isect,
-                                         visibility
-#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-                                         ,
-                                         lcg_state,
-                                         difl,
-                                         extmax
-#endif
-      );
+      return BVH_FUNCTION_FULL_NAME(BVH)(kg, ray, isect, visibility);
   }
   kernel_assert(!"Should not happen");
   return false;
@@ -466,4 +361,3 @@ ccl_device_inline bool BVH_FUNCTION_NAME(KernelGlobals *kg,
 #undef BVH_FUNCTION_NAME
 #undef BVH_FUNCTION_FEATURES
 #undef NODE_INTERSECT
-#undef NODE_INTERSECT_ROBUST
index 16f3b03f842c68af0564285ed30b114f704aa53d..84dc0dbaef51048934d414c0aa8fe42b78e80df0 100644 (file)
@@ -38,7 +38,6 @@ CCL_NAMESPACE_BEGIN
 #define BVH_INSTANCING 1
 #define BVH_MOTION 2
 #define BVH_HAIR 4
-#define BVH_HAIR_MINIMUM_WIDTH 8
 
 #define BVH_NAME_JOIN(x, y) x##_##y
 #define BVH_NAME_EVAL(x, y) BVH_NAME_JOIN(x, y)
index 6831562cade0d3c1a435a89d11ab5d53c078bf1a..e5c935b75eda8665b4fcfbad713b005e640ceabc 100644 (file)
@@ -276,53 +276,6 @@ ccl_device_inline int obvh_aligned_node_intersect(KernelGlobals *ccl_restrict kg
 #endif
 }
 
-ccl_device_inline int obvh_aligned_node_intersect_robust(KernelGlobals *ccl_restrict kg,
-                                                         const avxf &isect_near,
-                                                         const avxf &isect_far,
-#ifdef __KERNEL_AVX2__
-                                                         const avx3f &P_idir,
-#else
-                                                         const avx3f &P,
-#endif
-                                                         const avx3f &idir,
-                                                         const int near_x,
-                                                         const int near_y,
-                                                         const int near_z,
-                                                         const int far_x,
-                                                         const int far_y,
-                                                         const int far_z,
-                                                         const int node_addr,
-                                                         const float difl,
-                                                         avxf *ccl_restrict dist)
-{
-  const int offset = node_addr + 2;
-#ifdef __KERNEL_AVX2__
-  const avxf tnear_x = msub(
-      kernel_tex_fetch_avxf(__bvh_nodes, offset + near_x * 2), idir.x, P_idir.x);
-  const avxf tfar_x = msub(
-      kernel_tex_fetch_avxf(__bvh_nodes, offset + far_x * 2), idir.x, P_idir.x);
-  const avxf tnear_y = msub(
-      kernel_tex_fetch_avxf(__bvh_nodes, offset + near_y * 2), idir.y, P_idir.y);
-  const avxf tfar_y = msub(
-      kernel_tex_fetch_avxf(__bvh_nodes, offset + far_y * 2), idir.y, P_idir.y);
-  const avxf tnear_z = msub(
-      kernel_tex_fetch_avxf(__bvh_nodes, offset + near_z * 2), idir.z, P_idir.z);
-  const avxf tfar_z = msub(
-      kernel_tex_fetch_avxf(__bvh_nodes, offset + far_z * 2), idir.z, P_idir.z);
-
-  const float round_down = 1.0f - difl;
-  const float round_up = 1.0f + difl;
-  const avxf tnear = max4(tnear_x, tnear_y, tnear_z, isect_near);
-  const avxf tfar = min4(tfar_x, tfar_y, tfar_z, isect_far);
-  const avxb vmask = round_down * tnear <= round_up * tfar;
-  int mask = (int)movemask(vmask);
-  *dist = tnear;
-  return mask;
-#else
-  return 0;
-#endif
-}
-
 /* Unaligned nodes intersection */
 
 ccl_device_inline int obvh_unaligned_node_intersect(KernelGlobals *ccl_restrict kg,
@@ -391,77 +344,6 @@ ccl_device_inline int obvh_unaligned_node_intersect(KernelGlobals *ccl_restrict
   return movemask(vmask);
 }
 
-ccl_device_inline int obvh_unaligned_node_intersect_robust(KernelGlobals *ccl_restrict kg,
-                                                           const avxf &isect_near,
-                                                           const avxf &isect_far,
-#ifdef __KERNEL_AVX2__
-                                                           const avx3f &P_idir,
-#endif
-                                                           const avx3f &P,
-                                                           const avx3f &dir,
-                                                           const avx3f &idir,
-                                                           const int near_x,
-                                                           const int near_y,
-                                                           const int near_z,
-                                                           const int far_x,
-                                                           const int far_y,
-                                                           const int far_z,
-                                                           const int node_addr,
-                                                           const float difl,
-                                                           avxf *ccl_restrict dist)
-{
-  const int offset = node_addr;
-  const avxf tfm_x_x = kernel_tex_fetch_avxf(__bvh_nodes, offset + 2);
-  const avxf tfm_x_y = kernel_tex_fetch_avxf(__bvh_nodes, offset + 4);
-  const avxf tfm_x_z = kernel_tex_fetch_avxf(__bvh_nodes, offset + 6);
-
-  const avxf tfm_y_x = kernel_tex_fetch_avxf(__bvh_nodes, offset + 8);
-  const avxf tfm_y_y = kernel_tex_fetch_avxf(__bvh_nodes, offset + 10);
-  const avxf tfm_y_z = kernel_tex_fetch_avxf(__bvh_nodes, offset + 12);
-
-  const avxf tfm_z_x = kernel_tex_fetch_avxf(__bvh_nodes, offset + 14);
-  const avxf tfm_z_y = kernel_tex_fetch_avxf(__bvh_nodes, offset + 16);
-  const avxf tfm_z_z = kernel_tex_fetch_avxf(__bvh_nodes, offset + 18);
-
-  const avxf tfm_t_x = kernel_tex_fetch_avxf(__bvh_nodes, offset + 20);
-  const avxf tfm_t_y = kernel_tex_fetch_avxf(__bvh_nodes, offset + 22);
-  const avxf tfm_t_z = kernel_tex_fetch_avxf(__bvh_nodes, offset + 24);
-
-  const avxf aligned_dir_x = dir.x * tfm_x_x + dir.y * tfm_x_y + dir.z * tfm_x_z,
-             aligned_dir_y = dir.x * tfm_y_x + dir.y * tfm_y_y + dir.z * tfm_y_z,
-             aligned_dir_z = dir.x * tfm_z_x + dir.y * tfm_z_y + dir.z * tfm_z_z;
-
-  const avxf aligned_P_x = P.x * tfm_x_x + P.y * tfm_x_y + P.z * tfm_x_z + tfm_t_x,
-             aligned_P_y = P.x * tfm_y_x + P.y * tfm_y_y + P.z * tfm_y_z + tfm_t_y,
-             aligned_P_z = P.x * tfm_z_x + P.y * tfm_z_y + P.z * tfm_z_z + tfm_t_z;
-
-  const avxf neg_one(-1.0f);
-  const avxf nrdir_x = neg_one / aligned_dir_x, nrdir_y = neg_one / aligned_dir_y,
-             nrdir_z = neg_one / aligned_dir_z;
-
-  const avxf tlower_x = aligned_P_x * nrdir_x, tlower_y = aligned_P_y * nrdir_y,
-             tlower_z = aligned_P_z * nrdir_z;
-
-  const avxf tupper_x = tlower_x - nrdir_x, tupper_y = tlower_y - nrdir_y,
-             tupper_z = tlower_z - nrdir_z;
-
-  const float round_down = 1.0f - difl;
-  const float round_up = 1.0f + difl;
-
-  const avxf tnear_x = min(tlower_x, tupper_x);
-  const avxf tnear_y = min(tlower_y, tupper_y);
-  const avxf tnear_z = min(tlower_z, tupper_z);
-  const avxf tfar_x = max(tlower_x, tupper_x);
-  const avxf tfar_y = max(tlower_y, tupper_y);
-  const avxf tfar_z = max(tlower_z, tupper_z);
-
-  const avxf tnear = max4(isect_near, tnear_x, tnear_y, tnear_z);
-  const avxf tfar = min4(isect_far, tfar_x, tfar_y, tfar_z);
-  const avxb vmask = round_down * tnear <= round_up * tfar;
-  *dist = tnear;
-  return movemask(vmask);
-}
-
 /* Intersectors wrappers.
  *
  * They'll check node type and call appropriate intersection code.
@@ -526,66 +408,3 @@ ccl_device_inline int obvh_node_intersect(KernelGlobals *ccl_restrict kg,
                                        dist);
   }
 }
-
-ccl_device_inline int obvh_node_intersect_robust(KernelGlobals *ccl_restrict kg,
-                                                 const avxf &isect_near,
-                                                 const avxf &isect_far,
-#ifdef __KERNEL_AVX2__
-                                                 const avx3f &P_idir,
-#endif
-                                                 const avx3f &P,
-                                                 const avx3f &dir,
-                                                 const avx3f &idir,
-                                                 const int near_x,
-                                                 const int near_y,
-                                                 const int near_z,
-                                                 const int far_x,
-                                                 const int far_y,
-                                                 const int far_z,
-                                                 const int node_addr,
-                                                 const float difl,
-                                                 avxf *ccl_restrict dist)
-{
-  const int offset = node_addr;
-  const float4 node = kernel_tex_fetch(__bvh_nodes, offset);
-  if (__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) {
-    return obvh_unaligned_node_intersect_robust(kg,
-                                                isect_near,
-                                                isect_far,
-#ifdef __KERNEL_AVX2__
-                                                P_idir,
-#endif
-                                                P,
-                                                dir,
-                                                idir,
-                                                near_x,
-                                                near_y,
-                                                near_z,
-                                                far_x,
-                                                far_y,
-                                                far_z,
-                                                node_addr,
-                                                difl,
-                                                dist);
-  }
-  else {
-    return obvh_aligned_node_intersect_robust(kg,
-                                              isect_near,
-                                              isect_far,
-#ifdef __KERNEL_AVX2__
-                                              P_idir,
-#else
-                                              P,
-#endif
-                                              idir,
-                                              near_x,
-                                              near_y,
-                                              near_z,
-                                              far_x,
-                                              far_y,
-                                              far_z,
-                                              node_addr,
-                                              difl,
-                                              dist);
-  }
-}
index 98efb003788919b35eef8a3b7a211844a4df3913..4bae519578a1642464448b6cb0c50f2b806b575c 100644 (file)
@@ -503,10 +503,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
                                                    object,
                                                    prim_addr,
                                                    ray->time,
-                                                   curve_type,
-                                                   NULL,
-                                                   0,
-                                                   0);
+                                                   curve_type);
                   }
                   else {
                     hit = curve_intersect(kg,
@@ -517,10 +514,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
                                           object,
                                           prim_addr,
                                           ray->time,
-                                          curve_type,
-                                          NULL,
-                                          0,
-                                          0);
+                                          curve_type);
                   }
                   break;
                 }
index 86b1de48aaad460166ee7c39004926961fde48fa..b24e9977ffdb3dd1ef65767fc289736c6e057964 100644 (file)
  *
  * BVH_INSTANCING: object instancing
  * BVH_HAIR: hair curve rendering
- * BVH_HAIR_MINIMUM_WIDTH: hair curve rendering with minimum width
  * BVH_MOTION: motion blur rendering
  */
 
 #if BVH_FEATURE(BVH_HAIR)
 #  define NODE_INTERSECT obvh_node_intersect
-#  define NODE_INTERSECT_ROBUST obvh_node_intersect_robust
 #else
 #  define NODE_INTERSECT obvh_aligned_node_intersect
-#  define NODE_INTERSECT_ROBUST obvh_aligned_node_intersect_robust
 #endif
 
 ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
                                              const Ray *ray,
                                              Intersection *isect,
-                                             const uint visibility
-#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-                                             ,
-                                             uint *lcg_state,
-                                             float difl,
-                                             float extmax
-#endif
-)
+                                             const uint visibility)
 {
   /* Traversal stack in CUDA thread-local memory. */
   OBVHStackItem traversal_stack[BVH_OSTACK_SIZE];
@@ -117,38 +107,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
 
         BVH_DEBUG_NEXT_NODE();
 
-#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-        if (difl != 0.0f) {
-          /* NOTE: We extend all the child BB instead of fetching
-           * and checking visibility flags for each of the,
-           *
-           * Need to test if doing opposite would be any faster.
-           */
-          child_mask = NODE_INTERSECT_ROBUST(kg,
-                                             tnear,
-                                             tfar,
-#  ifdef __KERNEL_AVX2__
-                                             P_idir4,
-#  endif
-#  if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__)
-                                             org4,
-#  endif
-#  if BVH_FEATURE(BVH_HAIR)
-                                             dir4,
-#  endif
-                                             idir4,
-                                             near_x,
-                                             near_y,
-                                             near_z,
-                                             far_x,
-                                             far_y,
-                                             far_z,
-                                             node_addr,
-                                             difl,
-                                             &dist);
-        }
-        else
-#endif /* BVH_HAIR_MINIMUM_WIDTH */
         {
           child_mask = NODE_INTERSECT(kg,
                                       tnear,
@@ -501,32 +459,12 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
                 kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL));
                 bool hit;
                 if (kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) {
-                  hit = cardinal_curve_intersect(kg,
-                                                 isect,
-                                                 P,
-                                                 dir,
-                                                 visibility,
-                                                 object,
-                                                 prim_addr,
-                                                 ray->time,
-                                                 curve_type,
-                                                 lcg_state,
-                                                 difl,
-                                                 extmax);
+                  hit = cardinal_curve_intersect(
+                      kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type);
                 }
                 else {
-                  hit = curve_intersect(kg,
-                                        isect,
-                                        P,
-                                        dir,
-                                        visibility,
-                                        object,
-                                        prim_addr,
-                                        ray->time,
-                                        curve_type,
-                                        lcg_state,
-                                        difl,
-                                        extmax);
+                  hit = curve_intersect(
+                      kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type);
                 }
                 if (hit) {
                   tfar = avxf(isect->t);
@@ -617,4 +555,3 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
 }
 
 #undef NODE_INTERSECT
-#undef NODE_INTERSECT_ROBUST
index 7c1d8c8c72e5237fcae7196e0cb86658fcc4149d..bf2389eebadcdce2aa094393d1b3eeecd532cb30 100644 (file)
@@ -181,51 +181,6 @@ static int qbvh_aligned_node_intersect(KernelGlobals *ccl_restrict kg,
   return mask;
 }
 
-ccl_device_inline int qbvh_aligned_node_intersect_robust(KernelGlobals *ccl_restrict kg,
-                                                         const ssef &isect_near,
-                                                         const ssef &isect_far,
-#ifdef __KERNEL_AVX2__
-                                                         const sse3f &P_idir,
-#else
-                                                         const sse3f &P,
-#endif
-                                                         const sse3f &idir,
-                                                         const int near_x,
-                                                         const int near_y,
-                                                         const int near_z,
-                                                         const int far_x,
-                                                         const int far_y,
-                                                         const int far_z,
-                                                         const int node_addr,
-                                                         const float difl,
-                                                         ssef *ccl_restrict dist)
-{
-  const int offset = node_addr + 1;
-#ifdef __KERNEL_AVX2__
-  const ssef tnear_x = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + near_x), idir.x, P_idir.x);
-  const ssef tnear_y = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + near_y), idir.y, P_idir.y);
-  const ssef tnear_z = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + near_z), idir.z, P_idir.z);
-  const ssef tfar_x = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + far_x), idir.x, P_idir.x);
-  const ssef tfar_y = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + far_y), idir.y, P_idir.y);
-  const ssef tfar_z = msub(kernel_tex_fetch_ssef(__bvh_nodes, offset + far_z), idir.z, P_idir.z);
-#else
-  const ssef tnear_x = (kernel_tex_fetch_ssef(__bvh_nodes, offset + near_x) - P.x) * idir.x;
-  const ssef tnear_y = (kernel_tex_fetch_ssef(__bvh_nodes, offset + near_y) - P.y) * idir.y;
-  const ssef tnear_z = (kernel_tex_fetch_ssef(__bvh_nodes, offset + near_z) - P.z) * idir.z;
-  const ssef tfar_x = (kernel_tex_fetch_ssef(__bvh_nodes, offset + far_x) - P.x) * idir.x;
-  const ssef tfar_y = (kernel_tex_fetch_ssef(__bvh_nodes, offset + far_y) - P.y) * idir.y;
-  const ssef tfar_z = (kernel_tex_fetch_ssef(__bvh_nodes, offset + far_z) - P.z) * idir.z;
-#endif
-
-  const float round_down = 1.0f - difl;
-  const float round_up = 1.0f + difl;
-  const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z);
-  const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z);
-  const sseb vmask = round_down * tnear <= round_up * tfar;
-  *dist = tnear;
-  return (int)movemask(vmask);
-}
-
 /* Unaligned nodes intersection */
 
 ccl_device_inline int qbvh_unaligned_node_intersect(KernelGlobals *ccl_restrict kg,
@@ -308,85 +263,6 @@ ccl_device_inline int qbvh_unaligned_node_intersect(KernelGlobals *ccl_restrict
 #endif
 }
 
-ccl_device_inline int qbvh_unaligned_node_intersect_robust(KernelGlobals *ccl_restrict kg,
-                                                           const ssef &isect_near,
-                                                           const ssef &isect_far,
-#ifdef __KERNEL_AVX2__
-                                                           const sse3f &P_idir,
-#endif
-                                                           const sse3f &P,
-                                                           const sse3f &dir,
-                                                           const sse3f &idir,
-                                                           const int near_x,
-                                                           const int near_y,
-                                                           const int near_z,
-                                                           const int far_x,
-                                                           const int far_y,
-                                                           const int far_z,
-                                                           const int node_addr,
-                                                           const float difl,
-                                                           ssef *ccl_restrict dist)
-{
-  const int offset = node_addr;
-  const ssef tfm_x_x = kernel_tex_fetch_ssef(__bvh_nodes, offset + 1);
-  const ssef tfm_x_y = kernel_tex_fetch_ssef(__bvh_nodes, offset + 2);
-  const ssef tfm_x_z = kernel_tex_fetch_ssef(__bvh_nodes, offset + 3);
-
-  const ssef tfm_y_x = kernel_tex_fetch_ssef(__bvh_nodes, offset + 4);
-  const ssef tfm_y_y = kernel_tex_fetch_ssef(__bvh_nodes, offset + 5);
-  const ssef tfm_y_z = kernel_tex_fetch_ssef(__bvh_nodes, offset + 6);
-
-  const ssef tfm_z_x = kernel_tex_fetch_ssef(__bvh_nodes, offset + 7);
-  const ssef tfm_z_y = kernel_tex_fetch_ssef(__bvh_nodes, offset + 8);
-  const ssef tfm_z_z = kernel_tex_fetch_ssef(__bvh_nodes, offset + 9);
-
-  const ssef tfm_t_x = kernel_tex_fetch_ssef(__bvh_nodes, offset + 10);
-  const ssef tfm_t_y = kernel_tex_fetch_ssef(__bvh_nodes, offset + 11);
-  const ssef tfm_t_z = kernel_tex_fetch_ssef(__bvh_nodes, offset + 12);
-
-  const ssef aligned_dir_x = dir.x * tfm_x_x + dir.y * tfm_x_y + dir.z * tfm_x_z,
-             aligned_dir_y = dir.x * tfm_y_x + dir.y * tfm_y_y + dir.z * tfm_y_z,
-             aligned_dir_z = dir.x * tfm_z_x + dir.y * tfm_z_y + dir.z * tfm_z_z;
-
-  const ssef aligned_P_x = P.x * tfm_x_x + P.y * tfm_x_y + P.z * tfm_x_z + tfm_t_x,
-             aligned_P_y = P.x * tfm_y_x + P.y * tfm_y_y + P.z * tfm_y_z + tfm_t_y,
-             aligned_P_z = P.x * tfm_z_x + P.y * tfm_z_y + P.z * tfm_z_z + tfm_t_z;
-
-  const ssef neg_one(-1.0f, -1.0f, -1.0f, -1.0f);
-  const ssef nrdir_x = neg_one / aligned_dir_x, nrdir_y = neg_one / aligned_dir_y,
-             nrdir_z = neg_one / aligned_dir_z;
-
-  const ssef tlower_x = aligned_P_x * nrdir_x, tlower_y = aligned_P_y * nrdir_y,
-             tlower_z = aligned_P_z * nrdir_z;
-
-  const ssef tupper_x = tlower_x - nrdir_x, tupper_y = tlower_y - nrdir_y,
-             tupper_z = tlower_z - nrdir_z;
-
-  const float round_down = 1.0f - difl;
-  const float round_up = 1.0f + difl;
-
-#ifdef __KERNEL_SSE41__
-  const ssef tnear_x = mini(tlower_x, tupper_x);
-  const ssef tnear_y = mini(tlower_y, tupper_y);
-  const ssef tnear_z = mini(tlower_z, tupper_z);
-  const ssef tfar_x = maxi(tlower_x, tupper_x);
-  const ssef tfar_y = maxi(tlower_y, tupper_y);
-  const ssef tfar_z = maxi(tlower_z, tupper_z);
-#else
-  const ssef tnear_x = min(tlower_x, tupper_x);
-  const ssef tnear_y = min(tlower_y, tupper_y);
-  const ssef tnear_z = min(tlower_z, tupper_z);
-  const ssef tfar_x = max(tlower_x, tupper_x);
-  const ssef tfar_y = max(tlower_y, tupper_y);
-  const ssef tfar_z = max(tlower_z, tupper_z);
-#endif
-  const ssef tnear = max4(isect_near, tnear_x, tnear_y, tnear_z);
-  const ssef tfar = min4(isect_far, tfar_x, tfar_y, tfar_z);
-  const sseb vmask = round_down * tnear <= round_up * tfar;
-  *dist = tnear;
-  return movemask(vmask);
-}
-
 /* Intersectors wrappers.
  *
  * They'll check node type and call appropriate intersection code.
@@ -451,66 +327,3 @@ ccl_device_inline int qbvh_node_intersect(KernelGlobals *ccl_restrict kg,
                                        dist);
   }
 }
-
-ccl_device_inline int qbvh_node_intersect_robust(KernelGlobals *ccl_restrict kg,
-                                                 const ssef &isect_near,
-                                                 const ssef &isect_far,
-#ifdef __KERNEL_AVX2__
-                                                 const sse3f &P_idir,
-#endif
-                                                 const sse3f &P,
-                                                 const sse3f &dir,
-                                                 const sse3f &idir,
-                                                 const int near_x,
-                                                 const int near_y,
-                                                 const int near_z,
-                                                 const int far_x,
-                                                 const int far_y,
-                                                 const int far_z,
-                                                 const int node_addr,
-                                                 const float difl,
-                                                 ssef *ccl_restrict dist)
-{
-  const int offset = node_addr;
-  const float4 node = kernel_tex_fetch(__bvh_nodes, offset);
-  if (__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) {
-    return qbvh_unaligned_node_intersect_robust(kg,
-                                                isect_near,
-                                                isect_far,
-#ifdef __KERNEL_AVX2__
-                                                P_idir,
-#endif
-                                                P,
-                                                dir,
-                                                idir,
-                                                near_x,
-                                                near_y,
-                                                near_z,
-                                                far_x,
-                                                far_y,
-                                                far_z,
-                                                node_addr,
-                                                difl,
-                                                dist);
-  }
-  else {
-    return qbvh_aligned_node_intersect_robust(kg,
-                                              isect_near,
-                                              isect_far,
-#ifdef __KERNEL_AVX2__
-                                              P_idir,
-#else
-                                              P,
-#endif
-                                              idir,
-                                              near_x,
-                                              near_y,
-                                              near_z,
-                                              far_x,
-                                              far_y,
-                                              far_z,
-                                              node_addr,
-                                              difl,
-                                              dist);
-  }
-}
index 49e607bfbd03015deb82f81db8f997c268f62564..3845afd89697f9c04f442bdd9af19c9eb401a3d9 100644 (file)
@@ -293,10 +293,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
                                                  object,
                                                  prim_addr,
                                                  ray->time,
-                                                 curve_type,
-                                                 NULL,
-                                                 0,
-                                                 0);
+                                                 curve_type);
                 }
                 else {
                   hit = curve_intersect(kg,
@@ -307,10 +304,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
                                         object,
                                         prim_addr,
                                         ray->time,
-                                        curve_type,
-                                        NULL,
-                                        0,
-                                        0);
+                                        curve_type);
                 }
                 break;
               }
index 9ee0f7b59339d2058011075ff3f85c189c45877e..f43e84bf36876850647c7ed39c496a9d7f18d00b 100644 (file)
  *
  * BVH_INSTANCING: object instancing
  * BVH_HAIR: hair curve rendering
- * BVH_HAIR_MINIMUM_WIDTH: hair curve rendering with minimum width
  * BVH_MOTION: motion blur rendering
  */
 
 #if BVH_FEATURE(BVH_HAIR)
 #  define NODE_INTERSECT qbvh_node_intersect
-#  define NODE_INTERSECT_ROBUST qbvh_node_intersect_robust
 #else
 #  define NODE_INTERSECT qbvh_aligned_node_intersect
-#  define NODE_INTERSECT_ROBUST qbvh_aligned_node_intersect_robust
 #endif
 
 ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
                                              const Ray *ray,
                                              Intersection *isect,
-                                             const uint visibility
-#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-                                             ,
-                                             uint *lcg_state,
-                                             float difl,
-                                             float extmax
-#endif
-)
+                                             const uint visibility)
 {
   /* TODO(sergey):
    * - Test if pushing distance on the stack helps (for non shadow rays).
@@ -126,38 +116,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
 
         BVH_DEBUG_NEXT_NODE();
 
-#if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
-        if (difl != 0.0f) {
-          /* NOTE: We extend all the child BB instead of fetching
-           * and checking visibility flags for each of the,
-           *
-           * Need to test if doing opposite would be any faster.
-           */
-          child_mask = NODE_INTERSECT_ROBUST(kg,
-                                             tnear,
-                                             tfar,
-#  ifdef __KERNEL_AVX2__
-                                             P_idir4,
-#  endif
-#  if BVH_FEATURE(BVH_HAIR) || !defined(__KERNEL_AVX2__)
-                                             org4,
-#  endif
-#  if BVH_FEATURE(BVH_HAIR)
-                                             dir4,
-#  endif
-                                             idir4,
-                                             near_x,
-                                             near_y,
-                                             near_z,
-                                             far_x,
-                                             far_y,
-                                             far_z,
-                                             node_addr,
-                                             difl,
-                                             &dist);
-        }
-        else
-#endif /* BVH_HAIR_MINIMUM_WIDTH */
         {
           child_mask = NODE_INTERSECT(kg,
                                       tnear,
@@ -364,32 +322,12 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
                 kernel_assert((curve_type & PRIMITIVE_ALL) == (type & PRIMITIVE_ALL));
                 bool hit;
                 if (kernel_data.curve.curveflags & CURVE_KN_INTERPOLATE) {
-                  hit = cardinal_curve_intersect(kg,
-                                                 isect,
-                                                 P,
-                                                 dir,
-                                                 visibility,
-                                                 object,
-                                                 prim_addr,
-                                                 ray->time,
-                                                 curve_type,
-                                                 lcg_state,
-                                                 difl,
-                                                 extmax);
+                  hit = cardinal_curve_intersect(
+                      kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type);
                 }
                 else {
-                  hit = curve_intersect(kg,
-                                        isect,
-                                        P,
-                                        dir,
-                                        visibility,
-                                        object,
-                                        prim_addr,
-                                        ray->time,
-                                        curve_type,
-                                        lcg_state,
-                                        difl,
-                                        extmax);
+                  hit = curve_intersect(
+                      kg, isect, P, dir, visibility, object, prim_addr, ray->time, curve_type);
                 }
                 if (hit) {
                   tfar = ssef(isect->t);
@@ -480,4 +418,3 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
 }
 
 #undef NODE_INTERSECT
-#undef NODE_INTERSECT_ROBUST
index 5fd277c2f9971fc6fea46e705cf96d5a5a241c9d..0327ebf8890944c7c1155ec161d5504961ae1f97 100644 (file)
@@ -34,10 +34,7 @@ ccl_device_forceinline bool cardinal_curve_intersect(KernelGlobals *kg,
                                                      int object,
                                                      int curveAddr,
                                                      float time,
-                                                     int type,
-                                                     uint *lcg_state,
-                                                     float difl,
-                                                     float extmax)
+                                                     int type)
 {
   const bool is_curve_primitive = (type & PRIMITIVE_CURVE);
 
@@ -239,9 +236,6 @@ ccl_device_forceinline bool cardinal_curve_intersect(KernelGlobals *kg,
     return false;
 
   /* minimum width extension */
-  float mw_extension = min(difl * fabsf(upper), extmax);
-  float r_ext = mw_extension + r_curr;
-
   float xextrem[4];
   curvebounds(&lower,
               &upper,
@@ -253,7 +247,7 @@ ccl_device_forceinline bool cardinal_curve_intersect(KernelGlobals *kg,
               curve_coef[1].x,
               curve_coef[2].x,
               curve_coef[3].x);
-  if (lower > r_ext || upper < -r_ext)
+  if (lower > r_curr || upper < -r_curr)
     return false;
 
   float yextrem[4];
@@ -267,7 +261,7 @@ ccl_device_forceinline bool cardinal_curve_intersect(KernelGlobals *kg,
               curve_coef[1].y,
               curve_coef[2].y,
               curve_coef[3].y);
-  if (lower > r_ext || upper < -r_ext)
+  if (lower > r_curr || upper < -r_curr)
     return false;
 
   /* setup recurrent loop */
@@ -340,12 +334,8 @@ ccl_device_forceinline bool cardinal_curve_intersect(KernelGlobals *kg,
     float r2 = r_st + (r_en - r_st) * i_en;
     r_curr = max(r1, r2);
 
-    mw_extension = min(difl * fabsf(bmaxz), extmax);
-    float r_ext = mw_extension + r_curr;
-    float coverage = 1.0f;
-
-    if (bminz - r_curr > isect->t || bmaxz + r_curr < epsilon || bminx > r_ext || bmaxx < -r_ext ||
-        bminy > r_ext || bmaxy < -r_ext) {
+    if (bminz - r_curr > isect->t || bmaxz + r_curr < epsilon || bminx > r_curr ||
+        bmaxx < -r_curr || bminy > r_curr || bmaxy < -r_curr) {
       /* the bounding box does not overlap the square centered at O */
       tree += level;
       level = tree & -tree;
@@ -404,31 +394,7 @@ ccl_device_forceinline bool cardinal_curve_intersect(KernelGlobals *kg,
           continue;
         }
 
-        /* compute coverage */
-        float r_ext = r_curr;
-        coverage = 1.0f;
-        if (difl != 0.0f) {
-          mw_extension = min(difl * fabsf(bmaxz), extmax);
-          r_ext = mw_extension + r_curr;
-#  ifdef __KERNEL_SSE__
-          const float3 p_curr_sq = p_curr * p_curr;
-          const float3 dxxx(_mm_sqrt_ss(_mm_hadd_ps(p_curr_sq.m128, p_curr_sq.m128)));
-          float d = dxxx.x;
-#  else
-          float d = sqrtf(p_curr.x * p_curr.x + p_curr.y * p_curr.y);
-#  endif
-          float d0 = d - r_curr;
-          float d1 = d + r_curr;
-          float inv_mw_extension = 1.0f / mw_extension;
-          if (d0 >= 0)
-            coverage = (min(d1 * inv_mw_extension, 1.0f) - min(d0 * inv_mw_extension, 1.0f)) *
-                       0.5f;
-          else  // inside
-            coverage = (min(d1 * inv_mw_extension, 1.0f) + min(-d0 * inv_mw_extension, 1.0f)) *
-                       0.5f;
-        }
-
-        if (p_curr.x * p_curr.x + p_curr.y * p_curr.y >= r_ext * r_ext || p_curr.z <= epsilon ||
+        if (p_curr.x * p_curr.x + p_curr.y * p_curr.y >= r_curr * r_curr || p_curr.z <= epsilon ||
             isect->t < p_curr.z) {
           tree++;
           level = tree & -tree;
@@ -436,41 +402,23 @@ ccl_device_forceinline bool cardinal_curve_intersect(KernelGlobals *kg,
         }
 
         t = p_curr.z;
-
-        /* stochastic fade from minimum width */
-        if (difl != 0.0f && lcg_state) {
-          if (coverage != 1.0f && (lcg_step_float(lcg_state) > coverage))
-            return hit;
-        }
       }
       else {
         float l = len(p_en - p_st);
-        /* minimum width extension */
-        float or1 = r1;
-        float or2 = r2;
-
-        if (difl != 0.0f) {
-          mw_extension = min(len(p_st - P) * difl, extmax);
-          or1 = r1 < mw_extension ? mw_extension : r1;
-          mw_extension = min(len(p_en - P) * difl, extmax);
-          or2 = r2 < mw_extension ? mw_extension : r2;
-        }
-        /* --- */
         float invl = 1.0f / l;
         float3 tg = (p_en - p_st) * invl;
-        gd = (or2 - or1) * invl;
+        gd = (r2 - r1) * invl;
         float difz = -dot(p_st, tg);
         float cyla = 1.0f - (tg.z * tg.z * (1 + gd * gd));
         float invcyla = 1.0f / cyla;
-        float halfb = (-p_st.z - tg.z * (difz + gd * (difz * gd + or1)));
+        float halfb = (-p_st.z - tg.z * (difz + gd * (difz * gd + r1)));
         float tcentre = -halfb * invcyla;
         float zcentre = difz + (tg.z * tcentre);
         float3 tdif = -p_st;
         tdif.z += tcentre;
         float tdifz = dot(tdif, tg);
-        float tb = 2 * (tdif.z - tg.z * (tdifz + gd * (tdifz * gd + or1)));
-        float tc = dot(tdif, tdif) - tdifz * tdifz * (1 + gd * gd) - or1 * or1 -
-                   2 * or1 * tdifz * gd;
+        float tb = 2 * (tdif.z - tg.z * (tdifz + gd * (tdifz * gd + r1)));
+        float tc = dot(tdif, tdif) - tdifz * tdifz * (1 + gd * gd) - r1 * r1 - 2 * r1 * tdifz * gd;
         float td = tb * tb - 4 * cyla * tc;
         if (td < 0.0f) {
           tree++;
@@ -507,16 +455,6 @@ ccl_device_forceinline bool cardinal_curve_intersect(KernelGlobals *kg,
         w = saturate(w);
         /* compute u on the curve segment */
         u = i_st * (1 - w) + i_en * w;
-
-        /* stochastic fade from minimum width */
-        if (difl != 0.0f && lcg_state) {
-          r_curr = r1 + (r2 - r1) * w;
-          r_ext = or1 + (or2 - or1) * w;
-          coverage = r_curr / r_ext;
-
-          if (coverage != 1.0f && (lcg_step_float(lcg_state) > coverage))
-            return hit;
-        }
       }
       /* we found a new intersection */
 
@@ -556,10 +494,7 @@ ccl_device_forceinline bool curve_intersect(KernelGlobals *kg,
                                             int object,
                                             int curveAddr,
                                             float time,
-                                            int type,
-                                            uint *lcg_state,
-                                            float difl,
-                                            float extmax)
+                                            int type)
 {
   /* define few macros to minimize code duplication for SSE */
 #  ifndef __KERNEL_SSE2__
@@ -600,23 +535,14 @@ ccl_device_forceinline bool curve_intersect(KernelGlobals *kg,
     motion_curve_keys(kg, fobject, prim, time, k0, k1, P_curve);
   }
 
-  float or1 = P_curve[0].w;
-  float or2 = P_curve[1].w;
+  float r1 = P_curve[0].w;
+  float r2 = P_curve[1].w;
   float3 p1 = float4_to_float3(P_curve[0]);
   float3 p2 = float4_to_float3(P_curve[1]);
 
   /* minimum width extension */
-  float r1 = or1;
-  float r2 = or2;
   float3 dif = P - p1;
   float3 dif_second = P - p2;
-  if (difl != 0.0f) {
-    float pixelsize = min(len3(dif) * difl, extmax);
-    r1 = or1 < pixelsize ? pixelsize : or1;
-    pixelsize = min(len3(dif_second) * difl, extmax);
-    r2 = or2 < pixelsize ? pixelsize : or2;
-  }
-  /* --- */
 
   float3 p21_diff = p2 - p1;
   float3 sphere_dif1 = (dif + dif_second) * 0.5f;
@@ -635,20 +561,10 @@ ccl_device_forceinline bool curve_intersect(KernelGlobals *kg,
     motion_curve_keys(kg, fobject, prim, time, k0, k1, (float4 *)&P_curve);
   }
 
-  const ssef or12 = shuffle<3, 3, 3, 3>(P_curve[0], P_curve[1]);
-
-  ssef r12 = or12;
+  ssef r12 = shuffle<3, 3, 3, 3>(P_curve[0], P_curve[1]);
   const ssef vP = load4f(P);
   const ssef dif = vP - P_curve[0];
   const ssef dif_second = vP - P_curve[1];
-  if (difl != 0.0f) {
-    const ssef len1_sq = len3_squared_splat(dif);
-    const ssef len2_sq = len3_squared_splat(dif_second);
-    const ssef len12 = mm_sqrt(shuffle<0, 0, 0, 0>(len1_sq, len2_sq));
-    const ssef pixelsize12 = min(len12 * difl, ssef(extmax));
-    r12 = max(or12, pixelsize12);
-  }
-  float or1 = extract<0>(or12), or2 = extract<0>(shuffle<2>(or12));
   float r1 = extract<0>(r12), r2 = extract<0>(shuffle<2>(r12));
 
   const ssef p21_diff = P_curve[1] - P_curve[0];
@@ -754,15 +670,6 @@ ccl_device_forceinline bool curve_intersect(KernelGlobals *kg,
       z = zcentre + (dirz * correction);
     }
 
-    /* stochastic fade from minimum width */
-    float adjradius = or1 + z * (or2 - or1) * invl;
-    adjradius = adjradius / (r1 + z * gd);
-    if (lcg_state && adjradius != 1.0f) {
-      if (lcg_step_float(lcg_state) > adjradius)
-        return false;
-    }
-    /* --- */
-
     if (t > 0.0f && t < isect->t && z >= 0 && z <= l) {
 
       if (flags & CURVE_KN_ENCLOSEFILTER) {
index 2be1b7456321ce66766d52f62da009a8b01b9eed..aa9ce3621c7e6f56f00436707c2169bc5dbc0b61 100644 (file)
@@ -65,25 +65,7 @@ ccl_device_forceinline bool kernel_path_scene_intersect(KernelGlobals *kg,
     ray->t = kernel_data.background.ao_distance;
   }
 
-#ifdef __HAIR__
-  float difl = 0.0f, extmax = 0.0f;
-  uint lcg_state = 0;
-
-  if (kernel_data.bvh.have_curves) {
-    if ((kernel_data.cam.resolution == 1) && (state->flag & PATH_RAY_CAMERA)) {
-      float3 pixdiff = ray->dD.dx + ray->dD.dy;
-      /*pixdiff = pixdiff - dot(pixdiff, ray.D)*ray.D;*/
-      difl = kernel_data.curve.minimum_width * len(pixdiff) * 0.5f;
-    }
-
-    extmax = kernel_data.curve.maximum_width;
-    lcg_state = lcg_state_init_addrspace(state, 0x51633e2d);
-  }
-
-  bool hit = scene_intersect(kg, *ray, visibility, isect, &lcg_state, difl, extmax);
-#else
-  bool hit = scene_intersect(kg, *ray, visibility, isect, NULL, 0.0f, 0.0f);
-#endif /* __HAIR__ */
+  bool hit = scene_intersect(kg, *ray, visibility, isect);
 
 #ifdef __KERNEL_DEBUG__
   if (state->flag & PATH_RAY_CAMERA) {
index 6af1369feab7c6fead89f67189b48d463bed0e0a..0720181903052e286ddd0e716e399f9ccb3032c4 100644 (file)
@@ -103,8 +103,7 @@ ccl_device bool shadow_blocked_opaque(KernelGlobals *kg,
                                       Intersection *isect,
                                       float3 *shadow)
 {
-  const bool blocked = scene_intersect(
-      kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, isect, NULL, 0.0f, 0.0f);
+  const bool blocked = scene_intersect(kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, isect);
 #ifdef __VOLUME__
   if (!blocked && state->volume_stack[0].shader != SHADER_NONE) {
     /* Apply attenuation from current volume shader. */
@@ -319,8 +318,7 @@ ccl_device bool shadow_blocked_transparent_stepped_loop(KernelGlobals *kg,
       if (bounce >= kernel_data.integrator.transparent_max_bounce) {
         return true;
       }
-      if (!scene_intersect(
-              kg, *ray, visibility & PATH_RAY_SHADOW_TRANSPARENT, isect, NULL, 0.0f, 0.0f)) {
+      if (!scene_intersect(kg, *ray, visibility & PATH_RAY_SHADOW_TRANSPARENT, isect)) {
         break;
       }
       if (!shader_transparent_shadow(kg, isect)) {
@@ -376,8 +374,7 @@ ccl_device bool shadow_blocked_transparent_stepped(KernelGlobals *kg,
                                                    Intersection *isect,
                                                    float3 *shadow)
 {
-  bool blocked = scene_intersect(
-      kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, isect, NULL, 0.0f, 0.0f);
+  bool blocked = scene_intersect(kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, isect);
   bool is_transparent_isect = blocked ? shader_transparent_shadow(kg, isect) : false;
   return shadow_blocked_transparent_stepped_loop(
       kg, sd, shadow_sd, state, visibility, ray, isect, blocked, is_transparent_isect, shadow);
@@ -436,8 +433,7 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg,
    * TODO(sergey): Check why using record-all behavior causes slowdown in such
    * cases. Could that be caused by a higher spill pressure?
    */
-  const bool blocked = scene_intersect(
-      kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, &isect, NULL, 0.0f, 0.0f);
+  const bool blocked = scene_intersect(kg, *ray, visibility & PATH_RAY_SHADOW_OPAQUE, &isect);
   const bool is_transparent_isect = blocked ? shader_transparent_shadow(kg, &isect) : false;
   if (!blocked || !is_transparent_isect || max_hits + 1 >= SHADOW_STACK_MAX_HITS) {
     return shadow_blocked_transparent_stepped_loop(
index 3f62b726b6abfd174cd13549acec4e7e87786e43..0c6b4b401f04848213170ab5b019ae407595d307 100644 (file)
@@ -1372,8 +1372,7 @@ typedef struct KernelCurves {
   int curveflags;
   int subdivisions;
 
-  float minimum_width;
-  float maximum_width;
+  int pad1, pad2;
 } KernelCurves;
 static_assert_align(KernelCurves, 16);
 
index 0257e18c3e8da2bb2b0e9026621d61987ea9cdf6..e6d0016808d5b0bd0f54a55badc45723ab7aba25 100644 (file)
@@ -1373,7 +1373,7 @@ bool OSLRenderServices::trace(TraceOpt &options,
 
   /* Raytrace, leaving out shadow opaque to avoid early exit. */
   uint visibility = PATH_RAY_ALL_VISIBILITY - PATH_RAY_SHADOW_OPAQUE;
-  return scene_intersect(sd->osl_globals, ray, visibility, &tracedata->isect, NULL, 0.0f, 0.0f);
+  return scene_intersect(sd->osl_globals, ray, visibility, &tracedata->isect);
 }
 
 bool OSLRenderServices::getmessage(OSL::ShaderGlobals *sg,
index 06076175c4024e8182e348405b898ba90d5337fc..2efce5cb890403130045fbdb267202db5a265a15 100644 (file)
@@ -70,7 +70,7 @@ ccl_device_noinline float svm_ao(KernelGlobals *kg,
     }
     else {
       Intersection isect;
-      if (!scene_intersect(kg, ray, PATH_RAY_SHADOW_OPAQUE, &isect, NULL, 0.0f, 0.0f)) {
+      if (!scene_intersect(kg, ray, PATH_RAY_SHADOW_OPAQUE, &isect)) {
         unoccluded++;
       }
     }
index 49ab70541c210c12799de5a112becb3cb6e7beae..66fbc9eb4a88eb4a13c545644837cd5186066813 100644 (file)
@@ -88,9 +88,6 @@ CurveSystemManager::CurveSystemManager()
   resolution = 3;
   subdivisions = 3;
 
-  minimum_width = 0.0f;
-  maximum_width = 0.0f;
-
   use_curves = true;
   use_encasing = true;
   use_backfacing = false;
@@ -138,8 +135,6 @@ void CurveSystemManager::device_update(Device *device,
     if (use_encasing)
       kcurve->curveflags |= CURVE_KN_ENCLOSEFILTER;
 
-    kcurve->minimum_width = minimum_width;
-    kcurve->maximum_width = maximum_width;
     kcurve->subdivisions = subdivisions;
   }
 
@@ -160,8 +155,6 @@ bool CurveSystemManager::modified(const CurveSystemManager &CurveSystemManager)
       line_method == CurveSystemManager.line_method && primitive == CurveSystemManager.primitive &&
       use_encasing == CurveSystemManager.use_encasing &&
       use_tangent_normal_geometry == CurveSystemManager.use_tangent_normal_geometry &&
-      minimum_width == CurveSystemManager.minimum_width &&
-      maximum_width == CurveSystemManager.maximum_width &&
       use_backfacing == CurveSystemManager.use_backfacing &&
       triangle_method == CurveSystemManager.triangle_method &&
       resolution == CurveSystemManager.resolution && use_curves == CurveSystemManager.use_curves &&
index 81e7b4ac88d7f36c5962a06c8aee9df2e0373865..ade289a402ee3496d9a13261eeba4a566bf95538 100644 (file)
@@ -92,9 +92,6 @@ class CurveSystemManager {
   int resolution;
   int subdivisions;
 
-  float minimum_width;
-  float maximum_width;
-
   bool use_curves;
   bool use_encasing;
   bool use_backfacing;