Ambiguous cases
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.
Default behavior:
- In the : the render target takes the render pass result for the active layer.
- Batch rendering: the render target takes the render pass result for the master layer (regardless of active layer).
- If your render pass is shared between two or more render layers, none of which is the master layer, and your render target's
renderLayer input is not connected to any layer, your render target renders black. An example of such a scenario is illustrated
below.
You can avoid this ambiguous case as follows:
- If your render layers do not share render passes.
- By connecting the message output of the render layer to the renderLayer input of the render target.
- By connecting a rendered image source node to the render target to force the render pass to be taken from the connected layer.
Customizing your compositing graph so that your render target forces the render pass to be taken from a specific layer
Method 1
- the render layer node to render target node. The appears. Connect layer1.message to renderTarget1.renderLayer.
TipIf you do not see the and attributes in the, select and to expose them.
Method 2
- Create a node by using this MEL script:
shadingNode -asRendering renderedImageSource;
- the render layer node to the node. The appears. Connect layer1.message to renderedImageSource1.renderLayer.
- the render pass node to the node. The appears. Connect <pass>.message to renderedImageSource1.imageSource.
- + to connect the node and 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 by connecting the message output of the render layer to the renderLayer input of the render target.
Note
Rendering render targets: Rendering more than one renderable camera is currently not supported when rendering render targets.
This also applies to per layer overrides on the renderable camera.
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.