Sunday, June 12, 2011

Autodesk Maya Tutorials: How to Add Depth of Field in Maya






Copy and Paste URL to download scene and follow my Tutorials:
http://2shared.com/file/jzg3uv6u/Bee_scene.html


                                                             Depth Of Field
Depth of Field is one of those things that is more often than not, over used. However it does form an important role in generating realistic imagery in 3 dimensional environments. This tutorial does not discuss the correct use of DOF, but instead will show a simple but effective way to set-up a camera that can control DOF without needing work out distances.

Essentially what we want is a camera that will adjust its own DOF value according to the distance from the camera to a point we specify. We could create a camera and a locator and create a connection, but Maya already provides a camera that we can use. Select Create>Cameras>Camera and Aim to create a camera that already has an aim constraint.

Make sure your Camera is Facing the Object see "Maya Tutorials: 67-Understanding the basics of cameras" to learn how to manipulate cameras.

Now go to View>Camera attributes editor,

 


 in your Camera Attributes editor scroll down till you find the Depth of field option and expand it. Check Depth Of Field in there you will find 3 additional options we will leave them for now.

Render the Scene, after the first render you will notice that your scene is Blurry, this is because we don't know the Focus distance and we are just using the default focus distance that Maya has for us. but we will need to correct this. we can do easily calculate the distance by using a Locator.

Select Display>Heads up Display> and then "Object Details",


this will enable you to see the Distance from a specific point.

"Now because we want to measure the accurate distance from the camera to a specific area we will need to place a locater that will help us determine the distance" Select Create>Locater.

You will need to click on the locators and it will be placed in the scene. The locater can be moved to any place within your scene and maya will calculate the distance from the location of the Locater to the Camera in real time and can be viewed on the Top right hand side of your screen"See image 1 up". When you find out the distance between your scene and the Focus point/Locator, Type it into the Focus Distance Box and render,  you will notice the realism.

Don't worry, the locater will not render :)


Now going back to our DOF settings, we have 3 additional settings namely Focus Distance, F stop and Focus Region scale.

-Focus Distance: this is the distance of focus, the shorter the distance the further away the focus and the image will be blurry

-F stop: this works exactly like the 35mm camera the wider the lens the lower the number eg 1.8 will be a very wide lens and will give you a lot more depth of field and the Blurry starts earlier in the scene. Again if you increase to 10, you will have allot less depth of field and you will have a smaller perspective of the scene.

-Focus Region scale: this is pretty much your fudge factor, so the higher the Focus region scale, the bigger the region of focus :). However if your F Stope isn't giving you exactly what you want then you can go ahead and adjust the focus region.