Fix T103403: Lightgroup passes can contain lighting on shadow catchers
This commit is contained in:
parent
bc5337a05a
commit
00a20aec07
Notes:
blender-bot
2023-02-14 06:00:49 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3 Referenced by issue #103403, Regression: Area lamps ignore the Shadow Catcher property on objects in light group passes
|
@ -364,7 +364,9 @@ ccl_device_inline void film_write_emission_or_background_pass(
|
|||
}
|
||||
# endif /* __DENOISING_FEATURES__ */
|
||||
|
||||
if (lightgroup != LIGHTGROUP_NONE && kernel_data.film.pass_lightgroup != PASS_UNUSED) {
|
||||
const bool is_shadowcatcher = (path_flag & PATH_RAY_SHADOW_CATCHER_HIT) != 0;
|
||||
if (!is_shadowcatcher && lightgroup != LIGHTGROUP_NONE &&
|
||||
kernel_data.film.pass_lightgroup != PASS_UNUSED) {
|
||||
film_write_pass_spectrum(buffer + kernel_data.film.pass_lightgroup + 3 * lightgroup,
|
||||
contribution);
|
||||
}
|
||||
|
@ -373,13 +375,12 @@ ccl_device_inline void film_write_emission_or_background_pass(
|
|||
/* Directly visible, write to emission or background pass. */
|
||||
pass_offset = pass;
|
||||
}
|
||||
else if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) {
|
||||
else if (is_shadowcatcher) {
|
||||
/* Don't write any light passes for shadow catcher, for easier
|
||||
* compositing back together of the combined pass. */
|
||||
if (path_flag & PATH_RAY_SHADOW_CATCHER_HIT) {
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) {
|
||||
if (path_flag & PATH_RAY_SURFACE_PASS) {
|
||||
/* Indirectly visible through reflection. */
|
||||
const Spectrum diffuse_weight = INTEGRATOR_STATE(state, path, pass_diffuse_weight);
|
||||
|
|
Loading…
Reference in New Issue