From 7a92b8820b9661af39165f048d716559e513ddab Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 16 Mar 2019 22:05:37 +0100 Subject: 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 --- intern/cycles/kernel/kernel_path.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'intern/cycles/kernel/kernel_path.h') diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index 2be1b745632..aa9ce3621c7 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -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) { -- cgit v1.2.3