Changes:
- After hitting a shadow catcher, re-initialize the volume stack taking into account shadow catcher ray visibility. This ensures that volume objects are included in the stack only if they are shadow catchers.
- If there is a volume to be shaded in front of the shadow catcher, the split is now performed in the shade_volume kernel after volume shading is done.
- Previously the background pass behind a shadow catcher was done as part of the regular path, now it is done as part of the shadow catcher path.
For a shadow catcher path with volumes and visible background, operations are
done in this order now:
- intersect_closest
- shade_volume
- shadow catcher split
- intersect_volume_stack
- shade_background
- shade_surface
The world volume is shaded in both the shadow and non-shadow catcher paths
now, which means the fog is assumed to already exist in the footage. We may
consider adding an option to control this, or change the default. With a
volume object this control is already possible.
This includes refactoring to centralize the logic for next kernel scheduling
in intersect_closest.h.