From 659ba012b0f30450c6de13f8b1c2fccce32fc461 Mon Sep 17 00:00:00 2001 From: Mathieu Menuet Date: Tue, 12 Sep 2017 15:13:55 +0200 Subject: Cycles: change AO bounces approximation to do more glossy and transmission. Rather than treating all ray types equally, we now always render 1 glossy bounce and unlimited transmission bounces. This makes it possible to get good looking results with low AO bounces settings, making it useful to speed up interior renders for example. Reviewed By: brecht Differential Revision: https://developer.blender.org/D2818 --- intern/cycles/kernel/kernel_path_state.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'intern/cycles/kernel/kernel_path_state.h') diff --git a/intern/cycles/kernel/kernel_path_state.h b/intern/cycles/kernel/kernel_path_state.h index af208ff37f1..bedcd655bc6 100644 --- a/intern/cycles/kernel/kernel_path_state.h +++ b/intern/cycles/kernel/kernel_path_state.h @@ -143,7 +143,7 @@ ccl_device_inline void path_state_next(KernelGlobals *kg, ccl_addr_space PathSta #endif } -ccl_device_inline uint path_state_ray_visibility(KernelGlobals *kg, PathState *state) +ccl_device_inline uint path_state_ray_visibility(KernelGlobals *kg, ccl_addr_space PathState *state) { uint flag = state->flag & PATH_RAY_ALL_VISIBILITY; @@ -214,5 +214,15 @@ ccl_device_inline void path_state_modify_bounce(ccl_addr_space PathState *state, state->bounce -= 1; } +ccl_device_inline bool path_state_ao_bounce(KernelGlobals *kg, ccl_addr_space PathState *state) +{ + if(state->bounce <= kernel_data.integrator.ao_bounces) { + return false; + } + + int bounce = state->bounce - state->transmission_bounce - (state->glossy_bounce > 0); + return (bounce > kernel_data.integrator.ao_bounces); +} + CCL_NAMESPACE_END -- cgit v1.2.3