Advertisement

Creating Depth Of Field Using Maya Z-Depth Passes And Photoshop

by

Depth of field can prove to be a very effective way to add an overall sense of depth to your final renders, and also helps to draw the viewers focus to a specific area of the image (similar to a real world camera.) In this short tutorial Pratik Gulati, will cover the process of setting up and rendering out Z-Depth passes from Maya, which can later be combined with the beauty pass in Photoshop, to achieve a realistic DOF effect.

The gray values within a depth pass represent the distance from the camera, where white is near and black is far. The range in Maya units that this represents is based on the rendered camera's clipping planes. For this tutorial, I’ll be using Maya 2011 but the steps can be easily followed in both older and newer versions of Maya too.


Step 1

So the first thing to do is open your program.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 2

First create a simple scene using basic primitives, to test and render out our Z-depth pass (I've created a Plane and some Spheres.)

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 3

Next, select all the objects in the scene and create a new render layer with the selected objects.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 4

Maya method:

Right click (on the render layer) to open the "Attributes". This will open up a new window in the layer presets, select "Luminance Depth" from the menu.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 5

Select the camera (View>Select Camera) and open it's Attributes, make sure "Depth" is checked under the "Output Settings".

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 6

In the Edit Render Settings, we change the "Image" Path to our desired location so that we can save out the rendered images.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 7

Now we can do a "Batch Render" (Render>Batch Render) of our render layers and we will get the following output.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field
Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 8

Now for the MentalRay method:

First, we need to assign "Mental Ray" as our renderer by changing "Render Using" to "Mental Ray".

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 9

In the Render Passes options, I create a new "Camera Depth" pass. Then click on the Green Tick Icon, which will associate the selected pass with the current render layer.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 10

In the "Quality" tab, I increase the Sampling Quality as shown below, to get more refined and crisp edges in the render.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 11

We now render out the images using the "Batch Render" (Render>Batch Render) option.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 12

We now bring both our Z-depth render and Normal render into Photoshop.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 13

Now we copy the Z-depth image (Ctrl+A + Ctrl+C) and paste (Ctrl+V) it into the "Alpha" channel of our normal render.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 14

We now have the Z-depth render in the alpha channel. We next apply a "Lens Blur" filter by going to Filter>Blur>Lens Blur.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 15

This opens a new console. We first turn on the "Preview" option (by checking the box), so we can see the effect in real-time, we also need to choose "Alpha" as our source.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

Step 16

The "Blur Focus Distance" and the "Radius" settings are the most important parameters and will define the type of blur. If we decrease the distance setting, the blur will happen from the back to front. And if we increase it, it's the opposite.

Rendering Z-depth passes in Maya and compositing in Photoshop to achieve realistic depth of field

You can experiment with these settings to achieve an overall Depth Of Field you're happy with for your renders.


Related Tutorials:


Advertisement