
A compositing graph becomes ambiguous if a render target node is connected to a render pass that is shared between two render layers. The question arises as to which layer the render target would take its render pass result from.


You can avoid this ambiguous case as follows:
Customizing your compositing graph so that your render target forces the render pass to be taken from a specific layer
the render layer node to render target node. The Connection Editor appears. Connect layer1.message to renderTarget1.renderLayer.

shadingNode -asRendering renderedImageSource;
the render layer node to the renderedImageSource node. The Connection Editor appears. Connect layer1.message to renderedImageSource1.renderLayer.
the render pass node to the renderedImageSource node. The Connection Editor appears. Connect <pass>.message to renderedImageSource1.imageSource.
+
to connect the renderedImageSource node and renderTarget node.

Overriding the render settings using a render layer
If a render target is not connected to a specific render layer, it will, by default, render in the master layer using the render settings from the master layer. You can override these render settings by creating a render layer and connecting it to the render target. This way, the render target renders in the context of the render layer.
You can do this in the Hypershade by connecting the message output of the render layer to the renderLayer input of the render target.
Combining 3D output from different cameras
You can create a camera override by connecting a camera to the camera input of the render target. This signifies to the render target that all upstream connections in the compositing graph will use this 3D camera. This way, you can combine, in your pre-composite, the 3D output from different cameras.