Separate objects into layersΒΆ
Most of the time you need to separate objects into layers for compositing needs. For instance, render all objects in the foreground in a first layer and objects in the background in a second layer.
Let's render the sphere and plane into two separate layers: the LayerPlane and LayerSphere.
- Rename the Layer of the RenderPass to 'plane'.
- Create a secondary layer in the RenderPass, named 'sphere'.
Double-click into the previous NewRenderGraph.Create a Tags:plane node, a RenderLayers:plane node, a RenderLayers:sphere node, two binop.union nodes andconnect them as in the graph below.- Render the image.
The plane and the sphere are now rendered apart in their own layer. Check in the Render view that each layer contains the right geometry.
This RenderGraph can be explained like this :
In the branch that selects the plane Primitive via the plane Tag there is a Render Layer node, which renders the selection in the plane Layer of the RenderPass, since its Render Layer value is 'plane' and the plane Layer has 'plane' in its Layer Set. In the branch that selects the sphere Primitive via the sphere Tag there is a Render Layer node, which renders the selection in the sphere Layer of the RenderPass, since its Render Layer value is 'sphere' and the sphere Layer has 'sphere' in its Layer Set. Then those branches are merge together into a branch that is at its turn merge into the main branch.