diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-17 19:08:00 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-20 18:50:31 +0300 |
commit | cccfa597ba69944817e0913944cf3c3d0a6e1165 (patch) | |
tree | 331fe58a76d3413bd247d745f56ba3b0f35dbeeb /intern/cycles/kernel/kernel_accumulate.h | |
parent | 001f548227c413a4fdbee275744ea8bea886081a (diff) |
Cycles: make ambient occlusion pass take into account transparency again
Taking advantage of the new decoupled main and shadow paths. For CPU we
just store two nested structs in the integrator state, one for direct light
shadows and one for AO. For the GPU we restrict the number of shade surface
states to be executed based on available space in the shadow paths queue.
This also helps improve performance in benchmark scenes with an AO pass,
since it is no longer needed to use the shader raytracing kernel there,
which has worse performance.
Differential Revision: https://developer.blender.org/D12900
Diffstat (limited to 'intern/cycles/kernel/kernel_accumulate.h')
-rw-r--r-- | intern/cycles/kernel/kernel_accumulate.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_accumulate.h b/intern/cycles/kernel/kernel_accumulate.h index 848aaa18aae..54492bef974 100644 --- a/intern/cycles/kernel/kernel_accumulate.h +++ b/intern/cycles/kernel/kernel_accumulate.h @@ -408,6 +408,13 @@ ccl_device_inline void kernel_accum_light(KernelGlobals kg, const uint32_t path_flag = INTEGRATOR_STATE(state, shadow_path, flag); const int sample = INTEGRATOR_STATE(state, shadow_path, sample); + /* Ambient occlusion. */ + if (path_flag & PATH_RAY_SHADOW_FOR_AO) { + kernel_write_pass_float3(buffer + kernel_data.film.pass_ao, contribution); + return; + } + + /* Direct light shadow. */ kernel_accum_combined_pass(kg, path_flag, sample, contribution, buffer); #ifdef __PASSES__ |