Fix T52021: Shadow catcher renders wrong when catcher object is behind transparent object

Tweaked the path radiance summing and alpha to accommodate for possible contribution of
light by transparent surface bounces happening prior to shadow catcher intersection.

This commit will change the way how shadow catcher results looks when was behind semi
transparent object, but the old result seemed to be fully wrong: there were big artifacts
when alpha-overing the result on some actual footage.
This commit is contained in:
Sergey Sharybin
2017-07-18 09:25:58 +02:00
parent d8906f30d3
commit 5f35682f3a
5 changed files with 39 additions and 12 deletions

View File

@@ -643,11 +643,16 @@ ccl_device_inline float kernel_path_integrate(KernelGlobals *kg,
#ifdef __SHADOW_TRICKS__
if((sd.object_flag & SD_OBJECT_SHADOW_CATCHER)) {
if(state.flag & PATH_RAY_CAMERA) {
state.flag |= (PATH_RAY_SHADOW_CATCHER | PATH_RAY_SHADOW_CATCHER_ONLY | PATH_RAY_STORE_SHADOW_INFO);
state.flag |= (PATH_RAY_SHADOW_CATCHER |
PATH_RAY_SHADOW_CATCHER_ONLY |
PATH_RAY_STORE_SHADOW_INFO);
state.catcher_object = sd.object;
if(!kernel_data.background.transparent) {
L->shadow_color = indirect_background(kg, &emission_sd, &state, &ray);
L->shadow_background_color =
indirect_background(kg, &emission_sd, &state, &ray);
}
L->shadow_radiance_sum = path_radiance_clamp_and_sum(kg, L);
L->shadow_throughput = average(throughput);
}
}
else {