Extract render elements and save them separately.
- [Instructor] AOVs, or Arbitrary Output Variables, are a system of render passes and rendered layers in Arnold. AOVs are very powerful and versatile. We'll used them here to separate out the illumination from each light in the scene and also render out the backdrop separately. That'll give us a lot of options in compositing later. We'll begin by just setting up something in the project window. We're going to create a whole bunch of EXR files in this exercise, and we want to keep them separate from the rest of the files in the images folder.
The ordinary way of doing that from the render settings window doesn't work with AOVs, so we've got to go into the File menu to the Project Window. And here we have Primary Project Locations, images. At the end of images add a slash and AOV and this will save all of our renderings into a sub-folder within the images folder. Click Accept. And now let's go into the Render Settings and jump over to the AOVs tab.
In the AOV Bbowser we have three columns. AOV Groups is a list of categories. When you click on one, such as builtin, then the AOVs that are available within that category are displayed. If we wanted to render one of these we would select it. So scroll down and we can select direct, for example. And that'll render only the direct illumination and not any bounced light. Click on the right facing arrow to send it over to the Active AOVs column, and that new AOV appears at the bottom here.
There are three columns here too. There's the data column, which allows us to choose various forms of data, such as RGB or RGB plus alpha. There's the driver, which is the file format. By default it'll use the file format that you choose in the Common tab. Then there's also the filter here, which is a post render filter. Each one of these is a separate node in Maya. If I rendered this now I would get a beauty pass, which is the entire image and everything in it, and I would also get just the direct illumination saved out as a separate file.
In this case I want to create custom AOVs for my lights, so I don't need this one here. I'm going to select it and send it back using the left facing arrow. Now I have no active AOVs. For lights, we want to create AOVs with a special name, which will allow the light groups to find the AOVs. Click the Add Custom button. For these light groups, we need to prefix the name of the AOV with RGBA.
RGBA and an _ and then the name of a light group. We're going to create those in a moment, but they're going to have the format of the name of the light, such as key, k-e-y, and then an _ and the word light. So click Create. We've got one AOV created for the key light. Click Add Custom again and type in RBGA_fill_light and click create.
Click Add Custom one more time. And it'll be RGBA_back_light. And those are the AOVs that we need for our light groups. We also need an AOV for the backdrop. I've got a matte painting out here that we can't see, but it's actually a picture of Mt. Hood, and I want that to be on a separate layer in my compositing application. So we can created a custom AOV for that too. Click on Add Custom, and we can call in whatever we like.
Call it backdrop, and click Create. So now all of our AOVs are created. We can close the Render Settings dialog. Now we need to assign our lights to light groups that match the names of those AOVs. Open up the Outliner and select the backlight and open it's attributes with Ctrl+a. And this is an Arnold native AI Area Light. We can scroll down a bit to the field labeled AOV Light Group.
And we want to type in the name of the light group minus the RGBA. So this'll just be back_light. Let's now select the key light, in the Outliner. In it's attributes, open up the Arnold section and scroll down a bit, and here's AOV light group, once again. And it'll be key_light. Finally, we've got the fill light. Select that. Open up it's Arnold attributes and name it's AOV light group fill_light.
Okay, those are the light groups which correspond to the AOV names. Now let's set up a shader for our matte painting. We can close the Outliner and open up the Hypershade. In the Hypershade browser there's mattePainting_aiflat in the materials tab. Select that and in the graph, click the button to graph the input and output connections. Here's our current shader network. We've got an image of Mt. Hood here that's feeding into an Ai flat node, which is just like a Maya surface shader.
What we want to do is kind of hijack the color of this shader and plug it into an AOV and there's a special node fro that. In the Create window, under Arnold, Utility choose Aov and then click aiWriteColor. And the node is created and we want to plug it between this Ai flat node and the shading group that's connected to the actual scene geometry. So take the Out Color form aiflat and send it to Input of aiWriteColor.
Take the Out Color of aiWriteColor and feed it to the Surface Shader or the shading group. This is sufficient to cause the color of the matte painting to render into it's own AOV file, but we will not get the image in the beauty rendering. We'll get this blue field here. So we want to connect the Out Color to the Beauty input as well. Then select the aiWriteColor node and, very importantly, we need to choose the name of the AOV, here in the name field.
Of course, that AOV has to exist first. So from the pull down list, choose backdrop. Now we've set up our shader to accommodate our custom AOV and also to continue rendering in the beauty pass. We can close the Hypershade, and now we're ready to render. Let's do that from the RenderView. Open the RenderView and don't actually perform a render yet, but just click on the RenderView to open it. And that's the clapboard with an eye icon, and you want to resize that and position it on your screen, because once you start rendering you won't be able to move any windows around unless you hit the escape key, on the keyboard.
Now AOVs will render and save just fine if you use the ordinary Batch Render command, that you're probably used to, but if you don't have an Arnold license, from Solid Angle, then when you use the Batch Render command you'll get a watermark over your images. But we can use the Render Sequence command here to render out a still frame and that will save the AOVs as well, without a watermark. So let's set that up. In the RenderView window, go to the Render menu and choose Render Sequence options.
In here, we need to check this every time to set the Current Camera. So set it to camera1 and Close. Now we're ready to do our actual rendering. We can click Render Sequence from the toolbar here or we can choose Render, Render Sequence. Once that rendering has completed, we can check in on the file output. I've got that open in another window already. Here's the current project, the Exercise Files and in the images folder we now have an AOV folder.
Go in there and there's a sub-folder for each one of the AOVs. If we open up each one of those we will see that, unfortunately, they're all named the same filename, and that filename is simply what we provided in the Render Settings dialog, and in the absence of that it just uses the scene file name. And those are the various EXR documents that we need to composite together and we'll take a look at that in the following movie. And that's how to use AOVs to render out each light and shader separately.
- Arnold rendering concepts
- Lighting with Maya and Arnold lights
- Controlling exposure
- Filtering light with Gobo
- Light attenuation with Decay
- Image-based lighting with Skydome
- Exterior daylight with Physical Sky
- Arnold Standard Surface material attributes
- Mapping material attributes
- Rendering refractions
- Mesh subdivision and displacement at render time
- Shading effects such as ambient occlusion and vertex color
- Camera effects such as fisheye and depth of field
- Animation image sequence rendering