From BlenderWiki

Jump to: navigation, search

Renderlayers are used to separate your composite image into layers. Use RenderLayers for a specific reason - such as creating depth of field, relighting isolated elements within the image via a normal pass, adding a colorcast to specific portions of the image, etc. The keyword here is isolation. Renderlayers allow you to dissect, effect and or correct individual elements or groups within your composition before outputting your final render. This saves you from endlessly re-rendering your scene just to find out whether a correction is going to work or not.

Finding Render Layers

Manual-RenderLayer-Panel.png

In the Buttons Window, specifically the Scene Render buttons, the first panel has two tabs: Output and RenderLayers. You're close, if not already there. Click the RenderLayers tab header. This is where you select the layers that you want to render, and the settings for the upcoming render.

By default, the active layers in your scene are also active here. You know this because you have acutely observed that there are TWO sets of layer buttons here: one above the Render Layer name, and another set below (that has all the buttons selected). However, you can change that set of layers here; simply (⇧ ShiftLMB Template-LMB.png to select multiple layers that you want to render, or LMB Template-LMB.png to select a single layer to render.

Layer Sets AND each other
Only the objects in layers that are selected BOTH in the main Scene Layer group AND the Render Layer Layer group will be rendered. So, if the Scene has only Layer 1 selected, and your Render Layer set specifies to render only Layers 2 and 3, nothing but the Sky (if selected) will be rendered.


You might also have noticed that there are three possible states for these buttons. In the picture, the first button is dark gray (selected), the second is light gray (not selected), but the third button has a black dot. This is used to indicate a Z-mask, as we will describe below.

Using Render Layers

What are Render Layers really used for? Blender's node-based compositing system!

In Nodes, when you added an Input Node of type RenderLayers, and selected the Scene, you bring in whatever information you've specified for that RenderLayer. This node becomes a source for the rendering pipeline products you've specified (see below), as applied to the objects in the qualifying layer(s). Each of these products then "flow out of" that node toward their appointed destinations in the node graph you've constructed.

Render Layer settings

Render Layers are set up via four main groups of options:

  • Enabling and Naming
  • Scene Layers to Render
  • Pipeline Products to deliver
  • Passes to make available

Enabling and Naming

The checkbox enables or disables the computation of the whole render layer. Enable only those layers you are working with to save time. The selector allows you to scroll through and examine existing render layers, or to add a new one. You may name your render layers by ⇧ ShiftLMB Template-LMB.png into the name field. The "Single" button makes Blender render ONLY that render layer and none other. Enable this if you are working on a single layer to avoid rendering unwanted layers. The X deletes the layer.

Scene Layers to Render

The next group of controls are the layers to render. As noted above, this set of layer buttons are ANDed with the currently selected scene layers (shown at the top of the panel). If both corresponding buttons are enabled, the layer is fed into the render pipeline.

You can select that layer by LMB Template-LMB.pngclicking the button. To select multiple layers, ⇧ ShiftLMB Template-LMB.png click. (The dot in the button in this case turns dark gray.)

In Addition... You can select that layer to feed the Z mask (explained below), via CtrlLMB Template-LMB.png. (To indicate this, the button's dot turns black.) Deselect by CtrlLMB Template-LMB.png again.

Pipeline Products to deliver

Each renderlayer has its own set of major products to include in the rendering pipeline. To save time and give you control when working with passes, this set of buttons allow you to select which major products to render:

AllZ
Z-values are computed for everything in view, not just those things that are rendered. When disabled, objects not included in the render have no ("infinite") z value
Solid
Solid faces are rendered. All normal meshes are solid faced.
Halo
Halo materials are rendered
Z-transparency
Transparency may be Z-based or Ray-traced. If Z-based, enabling Ztra renders transparent areas with the z-value of what is behind the transparent area.
Sky
Turning on Sky renders the sky, as defined in your material world settings. Otherwise, a black alpha transparent background is rendered
Edge
If Edge is enable in the Output panel, objects in this renderlayer are given an outline edge. Turning on Edge pulls in the Edge settings from the Output tab, and adds an outline to the objects. Edges have to also be enabled on the Output tab.
Strand
Strands are strings of static particles that are colored as part of the material settings; they look like strands of hair, or grass.
Z-mask
The image rendered is from the objects that are between the selected layer(s) and the Z-mask layers. In the example, the cube is on layers 2 and 3, and the grass in on layer 1. In the render layer which we have arbitrarily chosen to call "zmask", as shown in the picture above, layer 1 is selected and layer 3 is designated as the Z-mask (as indicated by the black dot). Therefore, only that part of Layer 1 which is in front of the object on layer 3 (the cube) is rendered.
Light
Enter the name of a light group, and the scene will be lit with only those lights. Usually, you use this to speed up draft renders, of a scene that has complicated lighting, by entering the name of a small group of key lights.
Mat
Overrides all material settings to use the name of the Material entered. Use this to speed up draft renders. Use the default material to check basic lighting.

Passes to make available

Render Passes (Combined, Z, Vec, etc.) are discussed on the next page.

Creating a new Render Layer

By default, there is 1-Renderlayer created for you, and it includes all layers, whether they are used in your scene or not. To add yet another Render Layer, click the yellow up-down selector and select Add New render layer. You now have two Render Layers to choose from, and the active one is shown in the window. Each Render Layer will have its own set of layers that are rendered (sort of makes sense now, doesn't it?).

For example, you might have a robot in a scene with a ground object, buildings, etc. If the robot is on visible-layer 5, you would create one render layer named "Robot" with layer 5 selected in both the Scene: and Layer: buttons.

You would create another render layer (maybe named "stuff") that had all other layers EXCEPT layer 5 selected in both the Scene: and Layer: buttons. Then, back in the Node Editor, you would create TWO input nodes of type Render Layer: one for the Robot Render Layer, and another for the other Stuff. Run both through a mixer and out to the Composite viewer to get the big picture.

Examples

Rendering only certain objects

For example, suppose you have added a cool halo to your robot and you want to quickly see what it looks like. Suppose your scene has boxes on layer 1, laser rifles on layer 2, the robot on layer 5, and lights and camera on layer 20, and they are all selected and visible in 3d view. If you want to render just your robot, and he is on layer 5, you click on the render layer 5 button (which is below the Render Layer name), de-select sky (so that the sky/horizon is not rendered) and select Halo. Presto! When you render, only the robot is rendered (quickly) and not all the other elements of your scene (like the boxes he is running in front of).

Outlining only selected objects

To render an image where only one or two of the objects are outlined, move those objects onto layer(s) separate from everything else. Create a 1-Render Layer for those layer(s) by selecting only those layers in the Render Layer layer set. Create another 2-Render Layer for the other stuff. Enable the Edge option for 1-Render Layer (remember to also enable Edge on the Output tab) and make sure it is de-selected (off) for 2-Render Layer. In the Node Editor, create two input nodes, one for each Render Layer. Mix the two images. Done. Simple. Yea.