Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-03-17 00:05:37 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-04-24 15:39:47 +0300
commit7a92b8820b9661af39165f048d716559e513ddab (patch)
tree81ec891cb18bb04c72db20cf0cbff711dcdb64d0 /intern/cycles/kernel/bvh/qbvh_traversal.h
parent5f888e65c3e765d5c176d3f54cf7d20d216441fc (diff)
Cycles: remove hair minimum width support.
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
Diffstat (limited to 'intern/cycles/kernel/bvh/qbvh_traversal.h')
-rw-r--r--intern/cycles/kernel/bvh/qbvh_traversal.h73
1 files changed, 5 insertions, 68 deletions
diff --git a/intern/cycles/kernel/bvh/qbvh_traversal.h b/intern/cycles/kernel/bvh/qbvh_traversal.h
index 9ee0f7b5933..f43e84bf368 100644
--- a/intern/cycles/kernel/bvh/qbvh_traversal.h
+++ b/intern/cycles/kernel/bvh/qbvh_traversal.h
@@ -20,29 +20,19 @@
*
* 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