diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2017-11-28 13:46:50 +0300 |
---|---|---|
committer | Mai Lavelle <mai.lavelle@gmail.com> | 2017-11-28 13:49:11 +0300 |
commit | 1261f8eaa7d60554d8678ca2256f123951ed509d (patch) | |
tree | 4f3c0e280cf52e779ab32a9dbad26710f6afc2ba | |
parent | 63173dc7d526c07cd4e5a7aea1aa7546a60ae034 (diff) |
Cycles: Fix issue with AO in split kernel_path_background
Watch out for changes to variables passed by value, these changes
don't persist across the split.
-rw-r--r-- | intern/cycles/kernel/kernel_path.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index a2547ceddd6..c43cdedac3b 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -190,12 +190,6 @@ ccl_device_forceinline bool kernel_path_background_setup( return false; } - /* When using the ao bounces approximation, adjust background - * shader intensity with ao factor. */ - if(path_state_ao_bounce(kg, state)) { - throughput *= kernel_data.background.ao_bounces_factor; - } - #ifdef __BACKGROUND__ /* sample background shader */ return indirect_background_setup(kg, sd, state, ray); @@ -215,6 +209,13 @@ ccl_device_forceinline void kernel_path_background_finish( #ifdef __BACKGROUND__ /* sample background shader */ float3 L_background = indirect_background_finish(kg, sd, state, ray); + + /* When using the ao bounces approximation, adjust background + * shader intensity with ao factor. */ + if(path_state_ao_bounce(kg, state)) { + throughput *= kernel_data.background.ao_bounces_factor; + } + path_radiance_accum_background(L, state, throughput, L_background); #endif /* __BACKGROUND__ */ } |