Creating Depth Of Field With 3DSMax & Photoshop

Depth of Field is a cool effect that lets you bring focus to particular objects in the scene and blurring the rest of the background and foreground. Depth of Field (DOF) works according to Z, so distance is one of the important settings.

In this tutorial I am not going to talk about DOF technique in mental ray or Scanline. I'm just going to show the compositional way for simulating this effect with 3ds Max and Photoshop. In this way you just need to render your scene and then you can try out different distances for DOP. This way can be useful for style rendering and save a lot of time if you want to show different distances to your client.

Please Note: While I used the mental ray renderer for this tutorial, you can use VRay or Scanline as well.

So let's start!

Step 1

Open the following file (using the downloadable resources below) or use your own scene:

Step 2

This downloadable scene is ready for rendering. In the camera viewport hit Render. Then save the rendered image with a format that can support the alpha channel, such as TGA. Now need to get some information about depth of the scene. For this I used the Z Depth element. This element shows depth of scene in grayscale. The nearest objects appear in white, and the depth of the scene in black. Intermediate objects are in gray.

Step 3

Open the Render Setup dialog. In the Render Elements tab, hit Add. From the Render Elements list choose Z Depth (mostly at the end of list) and click OK (Fig.01).

Fig. 01_render_setup

Fig. 01_render_setup

Step 4

Now that Z Depth element has been added to your list, choose it and in bottom of Tab you will see the Z Depth Element parameters rollout. Here there are two fields that let you setup the minimum and maximum distances. For this scene, I changed Z Min to 20 and Z Max to 150. If you are using your own scene, you should render it several times and keep changing the Z Min and Z Max values until you get the right numbers (Fig.02).

Fig. 02_zdepth_element

Fig. 02_zdepth_element

Step 5

Now render the scene again. But first uncheck Final Gather because we don't need to use it now and it will cost render time. After hitting the render button, firstly the scene will be rendered and then it will give you Z Depth in another rendered frame window. Save it (Fig.03).

Fig. 03_zdepth

Fig. 03_zdepth

Step 6

Open both rendered pictures in Adobe Photoshop. While the Z Depth picture is active press Ctrl+A to select all the frames. Then press Ctrl+C to save them.

Step 7

Now choose the scene picture. In the Channel tab select Alpha channel. Press Ctrl+V to paste the Z Depth picture into it (Fig.04).

If you zoom into the picture you may find there are some hard edges in the Z Depth picture. We need to smooth them before moving to the next step (Fig.05).

Fig. 04_alpha_channel

Fig. 04_alpha_channel

Fig. 05_bluring

Fig. 05_bluring

Step 8

While the Alpha channel of the picture is selected, in the Filter menu choose Gaussian Blur from the Blur submenu. Change the Radius size until you're satisfied with the result. In this tutorial I used 0.9 in the Radius field (Fig.06).

Fig. 06_gaussian_blur

Fig. 06_gaussian_blur

Step 9

Now in the Channel tab select the RGB channel. It will show your original picture (Fig.07).

Step 10

Go to the Filter menu and this time choose Lens Blur from the Blur submenu.

Step 11

In Depth Map Source select Alpha channel. Now if you click on each object or place in your picture you will find that the camera will focus on it and the rest of scene will be blurry. You can also change the distance with Blur Focus Distance. The Radius value will set the maximum and minimum amount of blurring. And in the Noise group you can add noise to the blurry area (Fig.08).

Fig. 08_lens_blur_render

Fig. 08_lens_blur_render

So simply you can create DOF effect in any area of your picture with compositing 3ds Max and Photoshop. Just keep in mind that this composition cannot always work accurately!

Enter content...

Fetching comments...

Post a comment