In this lesson, we'll work on getting some of our basic passes set up for the compositing pipeline. OK, so now that we have the background separated from our CG elements, what we need to do now is start the process of setting up our various passes, so that way our compositing artist has all the information they need to work with. Now the actual passes that you need for your end may be different from scene to scene or from project to project, but there's a handful that are usually going to be pretty common. So we'll work on getting those set up. Now in Maya, we have a couple of different methods we can go about getting our passes. We have the mental ray passes that can be found in the render globals, and we also have render layers. Now I usually like to use a combination of these two. So using the render passes as a way of getting some of our basic information, and then using render layers as a way of getting some more specialized data out of Maya. So with something like the render passes, I usually like to use these as a way of getting things like direct illumination, indirect illumination, shadow passes, reflection passes, things like that. Now any time you're going to use these passes, you want to make sure that you are using an MIA material X passes. And if you take a look at our Hypershade, that's what we've been using up until this point for things like the truck, as well as the robot. So with this robot body material, if we take a look at that-- again this is an MIA material X passes. So with that in mind, we can come in and start to build out our different passes. So let's start with the various passes that we need. So let's come in and we'll add a diffuse, which will basically be direct illumination. Let's go ahead and I'll just Ctrl-click and add an indirect, so that way we can capture final gather lighting and things like that. Let's go ahead and add in a raw shadow, so that way we can isolate shadow information and alter those in the compositing pipeline. We'll put out a reflection pass, and let's output a specular. So let's go ahead and create those. OK. Now once those have been created, we need to associate those to the proper pass or the proper render layer. Now all the changes that I had made for the last several lessons have been made on a new render layer. So that's this main pass. So with this layer highlighted, let's come in, take our different passes, and associate those to that render layer, so that way when this layer is rendered out, it will output the proper information. Now using these passes, these are usually pretty safe-- diffuse, indirect, reflection, things like that. You can start to come in here and output some more specialized information, things like ambient occlusion, incidents, things like that. But usually, what I find is that if you ever have to go back and make adjustments to those-- let's say you need a different type of ambient occlusion or you need to adjust the size of the distance of your ambient occlusion. If you have to come back and re-render that, that means we have to re-render all of this all over again, which is extremely time-consuming. So for that reason, what I like to do is, again, use my passes for this really, really basic information. And then when it comes to more specialized things, like ambient occlusion, incidents, material IDs, I typically like to rely on render layers for that. So that way, if I ever need to come back and make adjustments to those, I can usually re-render those very, very quickly, because that's really, really simple information to re-render. And that just saves me the time of having to re-render everything all over again, which is what I would have to do if I were using passes for everything. OK. So let's set up something like ambient occlusion. So I'll just go ahead and start with a new render layer. So what we can do is just right-click on our existing render layer, and let's select the objects. With those selected, we'll build a new render layer. And this one, we'll call something like ambient occlusion. Typically I like to do a couple of different ambient occlusion passes-- one that maybe has a wide ambient occlusion, and maybe one that has a little bit tighter, smaller ambient occlusion. So we'll call this something like AO wide. OK. And on this one, let's make a couple of new nodes in here. So we'll drop in something like a new surface shader. OK, we'll call this AO wide material, or something like that. Now over here, let's go to our mental ray textures, drop in our ambient occlusion. There we are. We'll plug this into out color. And for the most part, everything in here should be pretty good to go. So what we can do is take this AO wide with this new render layer selected, we can right-click on our material, and assign that as a material override. So that way everything on this layer inherits this new material. So let's come in. We can save that image for comparison and re-render. OK. So here's our basic ambient occlusion. Now in this case, you can see where our IBL node still shows up in the background. So we just go back to our Lights tab, we'll grab our IBL, and take its primary visibility, make sure we turn that off. OK. And that gives us sort of this black background here, which in my case, I usually like to come in and try to match up the background with the rest of this ambient occlusion, so coming in and setting this to a nice white color. So I'll just go to my shot camera. We'll select that, and make sure we set the environment background color to something like white. So I can just make myself a layer override and set that to white. There we are. Very nice. So you can see, in this case, where my ambient occlusion renders in about four seconds, whereas my main pass rendered in about 30 seconds. So you can see a much, much shorter render time for something like this ambient occlusion render layer. And again, that's why I really sort of like to keep these things isolated on different layers, as opposed to using passes to hold everything. So if I ever needed to come back and make adjustments to my ambient occlusion pass, I could come back into Maya, adjust my shader, re-render it, and I can know that that's going to render out really, really quickly. Whereas again, if I were using this pass, and using an ambient occlusion pass within this render layer, using the mental ray passes, again, if I needed to come back and make adjustments to my ambient occlusion, then I would have to come back and render this very, very heavy pass all over again, just to get my ambient occlusion back out. OK. So that is going to be our ambient occlusion wide pass. Now like I said, I'll go ahead and maybe do another one for my compositor, so that way they can have a couple of different ambient occlusions to work with. So we'll once again grab all the objects in that layer, make a new render layer. We'll call this something like our tight ambient occlusion. Once again, drop in a new ambient conclusion texture. Drop in a new surface shader. Once again, connect that to the out color. And we'll assign this as a layer override. Now once again, we'll need to go back to our camera. And for this, once again, make a layer override for the background. Set the background to white. And I will once again need to go back to my IBL, because we need to make these changes on every render layer that we add. And make sure that the primary visibility is turned off, so that way, it again doesn't show up in the background. OK. So here's our ambient occlusion. Now at this point, it's still a fairly tight ambient occlusion. So we can always come in and now start to take this max distance, and maybe start to lower that a little bit. Maybe also come in here and lower this spread, so it's again, a little bit tighter, little bit more focused ambient. OK. So again, maybe start to come in here and lower that a little bit more. All right, there we go. So again, that kind of gives me a little bit tighter, little bit more focused ambient occlusion, that again, our compositor can come in and layer over. So we might want to come in and check this on a few different frames, just to make sure that everything does look right. OK, very nice. Now what you will probably also want to do for something like these new render layers, something like the ambient occlusion, it really doesn't require something like final gather. So what we could do is go into our indirect lighting tab, and for this ambient conclusion render layer, we could come in, make a layer override, and for that layer, disable our final gather. So that way, this pass just renders out a few seconds faster. So in this case, about seven seconds, is what we were getting with the ambient occlusion with the final gather turned on. And re-rendering this in this case really didn't make that much of a difference. But for a bit larger, bit more complicated scene, you might see a little bit more of an impact. I'm kind of a stickler for keeping my renders as efficient as possible, so I, just as a matter of habit, always try to go in and turn off these things that I really don't need it all. OK. So at this point, if we were to come in and batch render, we would get several different passes out. So we would have diffuse pass, indirect pass, reflection, shadow, specular, and combining that with our different render layers, we would also have a couple of different ambient occlusions. So this is a pretty good set-up for most situations. So having all of this information plus our ambient occlusion will, again, pretty much get your compositor through most situations. Now in our next lesson, I'll show you a few additional passes and a few additional layers that we can set up that will, again, maybe just give a little bit more control to our compositor when they get these renders.