Fix T95244: Cycles produces incorrect AO pass for shadow catchers

Differential Revision: https://developer.blender.org/D16951
This commit is contained in:
Lukas Stockner 2023-01-08 21:38:54 +01:00
parent d8e01150d6
commit 4546e35c92
Notes: blender-bot 2023-02-14 07:30:31 +01:00
Referenced by issue #95244, Compositing: Multiply node for Render + AO gives an unexpected result on background
1 changed files with 8 additions and 1 deletions

View File

@ -502,8 +502,15 @@ ccl_device_forceinline void integrate_surface_ao(KernelGlobals kg,
rng_state,
ccl_global float *ccl_restrict render_buffer)
{
const uint32_t path_flag = INTEGRATOR_STATE(state, path, flag);
if (!(kernel_data.kernel_features & KERNEL_FEATURE_AO_ADDITIVE) &&
!(INTEGRATOR_STATE(state, path, flag) & PATH_RAY_CAMERA)) {
!(path_flag & PATH_RAY_CAMERA)) {
return;
}
/* Skip AO for paths that were split off for shadow catchers to avoid double-counting. */
if (path_flag & PATH_RAY_SHADOW_CATCHER_PASS) {
return;
}