I have a large scene so I want to render it layer by layer and then combine it in compositor. However, separate view layers are not intersecting with each other (for example if sun is on the viewlayer_1, objects from viewlayer_2 are not getting any light). In previous version of Blender everything was easy to set up in Layer settings, but now I can't figure it out...
I guess I found a solution.
In Blender 2.81+ you need to click on the filter icon and chose sphere icon to make options holdout (it will make the pixels that make up the object transparent instead) and indirect only (object won't be rendered, but it will still render the effects this object has on the other in the form of reflections and indirect lighting) visible. It applies both of them to collection.
- Make option holdout visible in outliner (as descibed above).
- Create new view layer (or layers).
- On first layer activate holdout (sphere icon) next to all collections which you don't want to be visible.
- Repeat step 3 for other layers (chosing of course different collections to be visible).
- Use compositor (Alpha over node) to connect layers.