beauty | object_id pass (utility shader set to obj) |
The aov_write shader in combination with the utility shader is a useful combination for writing out an Object ID pass. This simple setup will allow you to use an ID pass in compositing software to identify certain objects by their color. We will also isolate certain objects and give them specific id's with which to group by color.
Note: Another (easier) method to define object masks is to use the Arnold Object Mask tag. See this tutorial for more details.
A video tutorial can be found here.
Another (easier) method to define object masks is to use the Arnold Object Mask tag. See this tutorial for more details.
A simplified example scene that also demonstrates this *AOV_write* workflow can be found here.
Start off by creating a standard_surface shader that you want to use as the beauty shader. Create > Arnold > Surface > standard_surface in the Material Manager. Assign it to the geometry that you want to create an Object ID render.
Open the Arnold Shader Network Editor of the material. You should see the standard_surface shader connected to the Arnold Beauty port as in the following image.
Now we need to create an aov_write_rgb shader (you must connect an aov_write node to each material that requires an AOV). We will use this shader to write out our 'Object ID' pass. From the search bar on the left, type 'aov_write_rgb'. Drag this shader onto the main work area in the center. Disconnect the Standard Surface shader from the Arnold Beauty port (click the yellow line to disconnect).
Connect the aov_write_rgb shader's output to the Arnold Beauty port. You can do this by clicking and holding the circle next to Output and dragging the yellow line onto the Arnold Beauty circle.
Select the aov_write_rgb shader and type 'ObjectID', into the aov_name. This is the name of the Object ID render pass that we want to create.
ObjectID added to aov_name of 'aov_write_rgb' shader
Final shader network
Add a custom AOV and rename it 'ObjectID' (the same name used for the 'aov_write_rgb' shader)
Utility shader's 'Object' mode uses the name of the shapes to compute the color
At the moment the roof geometry has multiple colors based on the individual objects that the roof is comprised of. However, we may want to have only one color for the whole of the roof. What can we do? Well, we can add an Arnold tag to the roof geometry and give it an id number.
Roof null geometry has Arnold Tag with 'id 1' added to User options
Roof without 'id' tag | Roof with Arnold tag set to 'id 1' |
We can also use the Object ID Color Mode to define individual id's to object's inside a group. For example, currently, all of the windows are grouped together and so render with the same id color. If we want to change the color of one of the window objects, we can repeat the above process but apply it to the first window using a different id number (id 2).
Arnold Tag parameter added to first window with 'id 2' added to User options
All windows use current 'id1' assigned to the house | 'id2' Arnold Tag assigned to first window within window group |