by Wendy Huther
In this tutorial we will set up a simple scene using 3DS Max and learn how to add a Depth of Field effect to our camera. The Depth of Field creates an effect of focusing on one object while the rest of the scene appears blurry. In the scene setup we will learn how to add a couple of lights, apply materials, and how to precisely position a camera into the Perspective viewport. Enjoy!
Let's start by setting our System Unit Setup to centimeters. We can do that by going to the Main toolbar – Customize – Units Setup, in the Units Setup dialog under Display Unit Scale – choose Metric – Centimeters, then press OK.
We will be using the Mental Ray renderer for this tutorial, so we can go to Rendering on the main toolbar, from the menu choose Render Setup, then in the Render Setup dialog, in the Common tab, scroll down to the bottom where we can find Assign Renderer. In Production we will find our render, if you are not already using Mental Ray, click on the small setting box and choose Mental Ray renderer from the Choose Renderer dialog. You can save the Mental Ray renderer as default render if you like.
We will just use a couple of planes and a few spheres for this scene, so let's go over to the Create panel , Geometry - Standard Primitives and from the Object type rollout choose Plane. We can go to the Top viewport and drag out a plane. Don't worry about the size. Go over to the Modify Panel to open the parameters for the Plane. Rename the Plane, we can call it Ground, set the Length to 1300 cm, Width to 1000 cm and the Length and Width Segs to 1.
We can centre the Plane in the viewport by using the Transform Type-in box at the bottom of the screen. First select the Select and Move Tool, then right click on the bottom dial of Axis X, Y, Z to reset them to 0, or just type in 0.
We are going to rotate this Plane to create a copy, so to do this first turn on the Angle Snap Toggle tool on the Main toolbar. This tool will help us control the rotation as it rotates 5º with each movement. Select the Select and Rotate tool and in the Top viewport, while holding the Shift key down on the keyboard, slowly drag the rotation tool from the top of the circle, through the center, at the same time you can watch the Transform tool at the bottom of the screen. Rotate until the Axis X = 90º . When we release the cursor the Clone Options dialog will appear, rename the object to Wall. Go back to the main toolbar and turn off the Angle Snap Toggle.
Let's change the length of the wall, to do this, select the wall, go over to the Modify panel , and in the Plane Parameters – Length set to 500cm. Now with the Select and Move tool drag the Wall to the back of the Ground.
Now we can create a sphere, let's go to the Create Panel , Geometry – Standard Primitives, from the Object type rollout choose Sphere. In the Top viewport we can drag out a sphere near the edge of the plane, then in the Modify panel – Sphere parameters –Rename it to Ball, set Radius to 25cm and segments to 32.
In the Left viewport press Z on the keyboard to zoom in and with the Select and Move tool position the sphere so it is sitting just on top on the plane.
Select the Sphere and while holding the Shift key down on the keyboard, with the Select and Move tool drag the Sphere up slightly to create a copy. In the Clone options dialog, choose Copy and set the number of copies to 7.
We will now add a couple of lights, let's go to Lights – Standard – Skylight. Click anywhere in the Perspective viewport to drop the Skylight. (Don't worry about the position) Next we can go to the Modify Panel - Skylight Parameters and set the Multiplier to 0,3.
We will also add an Omni light, so go back to Lights – Standard – Omni. Click to drop the Omni light on the left side of the first Sphere in the Top viewport. Use the Select and Move tool in the Perspective viewport to drag the light up.
Next we will go to the Modify panel – Omni General parameters – Turn on Shadows – Choose Ray Traced Shadows, in Intensity/Color/Attenuation - Multiplier set to 0,4.
Now our scene ready, all we need is to apply some materials and add a camera. Select the Material Editor from the Main toolbar or press M on the keyboard, select the Slate Material Editor. We are going to create the material for the spheres first, so right click any where in View1, go to Materials – Mental Ray – Arch & Design.
Double click on the Arch & Design material to access the Main Material parameters. First we will rename the material Ball. Then click on the Diffuse colour box and choose a pale blue from the Color Selector, then OK. Don't close the Material Editor yet we will apply the materials to the spheres in the next step.
We will use the Select By Name tool to select all the spheres in our scene. Go to Select by Name on the Main toolbar, in Geometry , click on Ball, then while holding the CTRL key down on the keyboard, select the other Balls in the list, then OK. (This is an easy tool for selecting anything thing in the scene).
With all the spheres selected we can go back to the Material Editor, press Assign Material to Selection , then press Show Shaded Material in Viewport . We have now assigned a Glossy material to all the spheres.
Next we will create a material for the Ground, but we will use a Standard material. Right click in View1, Materials – Standard – Standard. Double click the material to access the Shader Basic Material Parameters. Rename it to Ground, and in the Diffuse colour box choose a whitey/grey colour, then OK. Click the Ground to select it in the Perspective viewport, press Assign Material to Selection , then press Show Shaded Material in Viewport.
Create an other Standard material for the wall, rename it Wall, in the Diffuse colour choose a pale blue, then assign it to the Wall.
We can go to the Perspective viewport and using the viewport controls tools (zoom, pan and orbit) , which are situated at the bottom right side of the screen, position the scene the same as this image.
When we are happy with the scene, go to Views on the Main toolbar, and choose Create Camera From View, or click CTRL C on the keyboard. If we look at the viewports we can see that our camera has been precisely placed into the scene, and the Perspective viewport has changed to Camera001 viewport.
Let's go to the top left corner in the Camera001 viewport, and right click on the name Camera001, in the menu press Show Safety Frames, or press Shift F on the keyboard. This will allows us to view the exact portion of the scene we will get when rendered. By default the Image Custom output size is set to 640 x 480, we will change that later.
In the Front viewport click on the camera to select it, then go to the Modify Panel, in the Target Camera Parameters, scroll down to Multi-Pass Effect, check Enable and choose Depth of Field (mental ray), also check Render Effects Per Pass. Target Distance: set to 200 cm, (if we dial the Target Distance up and look at the Top viewport we can see how the Camera Target moves. The Target Distance will actually show you what will be in focus). In Depth of Field Parameters f-stop: set to 0,7 (this controls how blurry the rest of the scene will be)
Let's do a quick render to see the results. Go to the Main tool bar and press Render . Play with these two dials until you are happy with the results.
For our final render we can make a few adjustments, lets go to Rendering on the Main toolbar, Render Setup, in the Common tab, scroll down to Output Size - Choose HDTV (Video) and select the Width 480 and Height to 270 (or any other size), scroll down to the bottom, and in View: choose Camera001 and press the small lock. This way we will not be able to render through the other viewports by mistake. Now we can go to the Indirect Illumination Tab – Final Gather – Check Enable, set Initial FG Point Density to 0,4, set Rays per FG Point to 100, and Interpolate Over Num. FG Points to 10.
I hope you have found this tutorial helpful and can apply the Depth of Field Effect to future projects. Enjoy!
Subscribe to our Channel on YouTubeSubscribe