diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-09-13 19:28:31 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-09-20 20:38:08 +0300 |
commit | 90d4b823d72922922bb3d0af48ec2f592d210cdd (patch) | |
tree | 4b1a369c372d2223a8083a5abae41adc77dbe605 /intern/cycles/kernel/split | |
parent | 095a01a73a35d3af57573fc724d381bcca019f54 (diff) |
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.
Diffstat (limited to 'intern/cycles/kernel/split')
-rw-r--r-- | intern/cycles/kernel/split/kernel_shader_eval.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/intern/cycles/kernel/split/kernel_shader_eval.h b/intern/cycles/kernel/split/kernel_shader_eval.h index c792c4adb0e..7032461b04a 100644 --- a/intern/cycles/kernel/split/kernel_shader_eval.h +++ b/intern/cycles/kernel/split/kernel_shader_eval.h @@ -52,8 +52,14 @@ ccl_device void kernel_shader_eval(KernelGlobals *kg) shader_eval_surface(kg, &kernel_split_state.sd[ray_index], state, state->flag); #ifdef __BRANCHED_PATH__ - shader_merge_closures(&kernel_split_state.sd[ray_index]); -#endif /* __BRANCHED_PATH__ */ + if(kernel_data.integrator.branched) { + shader_merge_closures(&kernel_split_state.sd[ray_index]); + } + else +#endif + { + shader_prepare_closures(&kernel_split_state.sd[ray_index], state); + } } } |