Join Dariush Derakhshani for an in-depth discussion in this video Ambient occlusion, part of Learning V-Ray for Maya: A Professional Reference Guide.
In this video, we'll be taking a look at creating an Ambient Occlusion pass for our scene. Now, you may have noticed in the Elements tab in the Render settings, there is no Ambient Occlusion element that you can choose. You'll have to go through the Extra Tex element, which will give you these attributes. It'll allow you to attach a single texture node that will take the entire render and assign itself to all the objects in the scene as a pass-through texture.
This would be similar to taking a surface shader and assigning it to everything in the scene and rendering that. Now, for an Ambient Occlusion, you'll want to use the V-Ray dirt shader which is found Right here, V-Ray Dirt and this Dirt map will essentially give you an Ambient Occlusion.
You don't have to assign it to anything, you don't have to put it on a surface shader and create a render layer override. The Extra Texture element will take care of it for you once you connect it. So we'll select the extra text in the render settings and we will middle mouse button, drag the V-Ray Dirt over to the texture attribute for the Extra Text element. You'll want to put in a file name suffix, for example A, O, or N bach.
To add that to the file name of the resulting render, or channel. It just makes it a little bit easier then saying V-Ray Dirt. You can also see N bach which will let you know that's the pass that you've got. Make sure you turn on, or keep on, consider for anti-aliasing. Otherwise, the texture that you've assigned to this render will not anti-alias. Let's take a look at a render at the default setting for that Dirt shader.
As the render begins after the GI calculation you will be able to go in and select the extra text there it Ambocc V-Ray Dirt begin to see your Ambient Occlusion render start to take shape. What's good about this process is that any displacements such as you can see on this box that is about to finish, are actually held intact. And as the render finishes you can see some great detail in the crevices and some of the cracks and gaps in the models that will add a nice sense of contact and density to your composition.
You would use this pass in conjuction with the Alpha Channel as a multiplier on top of your comp. Let's take a look at that in After Effects. Now, here we have the V-Ray Dirt, the Ambient Occlusion pass in After Effects. I'm going to go ahead and add a, an exposure so I can correct the gamma correction to 2.2 to lighten up the density of that Ambient Occlusion.
We'll go head and set this to a multiply operation and we can see an added density to our scene. Maybe a little bit too much, you'll want to back off on the Ambient Occlusion a little bit, perhaps around 40 percent will just add a little bit more contact in some of these areas. Now overall, the ambient inclusion will give you great bits of detail and density And this is multiplied directly on top of the Beauty render.
And it gives it a little bit more weight, particularly in these areas. Now, you may notice a little bit of a fringing. That's because if we turn all the way up, you can see some fringing, that's because of the Alpha channel. And what I will do is I will use the Alpha Channel, which looks like this and I will go ahead and cut the Ambient Occlusion with the luminance or the Alpha from the Alpha Channel and that'll help mitigate some of those fringes. Lets take a full look at the Ambient Occlusion pass. And let's take a look at how to get, overall the render to be much brighter and only have a little bit of contact at the smallest areas and crevices. To do that, we'll go ahead and go back into Maya and we'll need to select the V-Ray Dirt, and take a look at its attributes.
The number one way to control it is, of course, by adjusting the color. So that your densities may not need to be so dark, we can always add your own tinge of color to it. To control the tightness or the travel of the darkness, you'll want to increase or decrease your radius. We're at a default radius of 10, we'll change that to 1. We'll go ahead and we will save this frame into our Render History buffer.
There it is. And then we'll go ahead and re-render with a radius of 1. You can start to see that only the contact areas and some of the closest and smallest gaps are being shown with the Ambient Occlusion where everything else is turning to a flat white. This will create an Ambient Occlusion pass that will be more of a Contact Shadow pass, more than anything, and also a Fine Detail pass.
Once this finishes, we'll go ahead and put it into After Effects, and take a look at the difference between these two. Here in After Effects we'll go ahead and put the, the new ambient inclusion on here. We'll go ahead and add our 2.2 gamma correction to lighten it up a little bit. And we can take a quick look at how this pass. We'll multiply on top of our beauty. And again, you'll want to take your alpha and cut the V-Ray Dirt. This gives us a more specific contact pass.
For our objects without darkening any of the surfaces that may not need the darkening from the larger radius that we created earlier. The difference between the two passes, you can see right here, quite evident. You can easily stack them if you desire to make more of a dense contact, but you still want the gradual fall off of a larger radius. You can go ahead and stack that on top. In this video we took a look at how the V-Ray Ambient Occlusion is created by using the extra-text element alongside the V-Ray Dirt shader.
- What is V-Ray?
- V-Ray integration with Maya UI
- V-Ray lights and shaders
- Working with global illumination
- Object properties and render layers
- Creating passes and elements
- Rendering and optimizing