Fix T91861: Black environment behind shadow catcher

Always sample background pass behind shadow catcher (if the pass
exists, of course), regardless of whether shadow catcher will be
used as approximate or accurate.

Allows to combine accurate shadows into an environment map.

Differential Revision: https://developer.blender.org/D12747
This commit is contained in:
Sergey Sharybin 2021-10-04 12:57:21 +02:00
parent fc4886a314
commit f806bd8261
Notes: blender-bot 2023-02-14 07:25:51 +01:00
Referenced by issue #91861, shadowcatcher objects appear black in the environment pass, makes it impossible to comp in the environment without rendering a second time with only the environment visible.
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ ccl_device_forceinline void integrator_intersect_shader_next_kernel(
#ifdef __SHADOW_CATCHER__
const int object_flags = intersection_get_object_flags(kg, isect);
if (kernel_shadow_catcher_split(INTEGRATOR_STATE_PASS, object_flags)) {
if (kernel_data.film.use_approximate_shadow_catcher && !kernel_data.background.transparent) {
if (kernel_data.film.pass_background != PASS_UNUSED && !kernel_data.background.transparent) {
INTEGRATOR_STATE_WRITE(path, flag) |= PATH_RAY_SHADOW_CATCHER_BACKGROUND;
if (use_raytrace_kernel) {