diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-11 10:33:18 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-11 14:49:50 +0300 |
commit | bd069a89aa3a2d166bc7cb4746a2b757497fdddc (patch) | |
tree | a16dad6a4c54b6ec2925758448109c0bccc2dae9 /intern/cycles/kernel/split | |
parent | 59a52fef6cebac25a296a9c8cc76017bf471f7ee (diff) |
Fix T52229: Shadow Catcher artifacts when under transparency
Added some extra tirckery to avoid background being tinted dark with transparent
surface. Maybe a bit hacky, but seems to work fine.
Diffstat (limited to 'intern/cycles/kernel/split')
-rw-r--r-- | intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h b/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h index 916b81faf4e..fe761305bfb 100644 --- a/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h +++ b/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h @@ -127,7 +127,6 @@ ccl_device void kernel_holdout_emission_blurring_pathtermination_ao( if(state->flag & PATH_RAY_CAMERA) { PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; state->flag |= (PATH_RAY_SHADOW_CATCHER | - PATH_RAY_SHADOW_CATCHER_ONLY | PATH_RAY_STORE_SHADOW_INFO); if(!kernel_data.background.transparent) { ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; @@ -141,8 +140,10 @@ ccl_device void kernel_holdout_emission_blurring_pathtermination_ao( L->shadow_throughput = average(throughput); } } - else { - state->flag &= ~PATH_RAY_SHADOW_CATCHER_ONLY; + else if(state->flag & PATH_RAY_SHADOW_CATCHER) { + /* Only update transparency after shadow catcher bounce. */ + PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; + L->shadow_transparency *= average(shader_bsdf_transparency(kg, sd)); } #endif /* __SHADOW_TRICKS__ */ |