From 90d4b823d72922922bb3d0af48ec2f592d210cdd Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 13 Sep 2017 18:28:31 +0200 Subject: Cycles: use defensive sampling for picking BSDFs and BSSRDFs. For the first bounce we now give each BSDF or BSSRDF a minimum sample weight, which helps reduce noise for a typical case where you have a glossy BSDF with a small weight due to Fresnel, but not necessarily small contribution relative to a diffuse or transmission BSDF below. We can probably find a better heuristic that also enables this on further bounces, for example when looking through a perfect mirror, but I wasn't able to find a robust one so far. --- intern/cycles/kernel/kernel_path.h | 5 ++--- 1 file changed, 2 insertions(+), 3 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 2df21f1cda3..d43d6374c13 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -435,9 +435,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg, &isect, ray); shader_eval_surface(kg, sd, state, state->flag); -#ifdef __BRANCHED_PATH__ - shader_merge_closures(sd); -#endif /* __BRANCHED_PATH__ */ + shader_prepare_closures(sd, state); /* Apply shadow catcher, holdout, emission. */ if(!kernel_path_shader_apply(kg, @@ -588,6 +586,7 @@ ccl_device_forceinline void kernel_path_integrate( /* Setup and evaluate shader. */ shader_setup_from_ray(kg, &sd, &isect, ray); shader_eval_surface(kg, &sd, state, state->flag); + shader_prepare_closures(&sd, state); /* Apply shadow catcher, holdout, emission. */ if(!kernel_path_shader_apply(kg, -- cgit v1.2.3