Thread: Depth of field
View Single Post
# 14 21-10-2003 , 04:59 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Alrighty. Starting with a new scene and default settings in Maya do the following:

Create two nurbs spheres @ 1 1 -5 and @ -1 1 5
Create a nurbs plane @ 0 0 0 and scale it up by 25
Create camera @ 0 1 15
Select Display->Camera/Light Manipulator->Clipping Planes (so that you can see what the next few settings do)
Uncheck the camera's "Auto Render Clip Plane
Set the cameras near clipping plane to 3
Set the cameras far clipping plane to 28
In render globals set:
- File Name Prefix: zDepthTest
- check the "Depth Channel(Z Depth)"
- change the camera from persp to camera1
- Resolution Preset: 640x480
- Anti-aliasing Quality Preset: Production
Batch render the frame

The Photoshop approach (not very good imho. if someone knows a better way i'd like to hear)
-------------------------------------------
open the zDepthTest.iff in photoshop (hopefully you got the maya iff plugin for photoshop. it's free but i can't remember where i found it). in photoshop select Window->Channels. you should see channels RGB, Red, Green, Blue, Alpha 1 and Alpha 2. Alpha 2 is the z-depth channel. click on it and zoom in to one of the spheres edges. it's all jagged and aliased. Do a gaussian blur with a radius of 1,0. Much better. Now zoom out to 100%. Control-click the Alpha 2 channel. The selection marquee looks a bit weird but let's ignore it. Choose Select->Inverse. Click on the RGB channel. Now start blurring with the selection still active and you should see the DOF like effect showing up.

The After Effects approach
-------------------------------------------
AE can read Maya IFF files but it can't (afaik) access the Alpha 2 channel (the z-depth info). Render the scene to an RLA file which is more suitable. Import the zDepthTest.rla in to AE and make a composition of it. Now apply an Effect->3D Channel->Depth Of Field. Nothing happens until you start tweaking the settings. For example:
- Focal Plane: 0,2 (this is the focus distance. keep withing 0 - 1. 0 = far, 1 = near)
- Maximum Radius: 5 (this is the max blurriness)
- Focal Plane Thickness: 0,1 (like focus region scale in maya. keep within 0-1)
Now you should have the furthest sphere in focus while the other is blurred. Change the focal plane to 0,7 and the foremost sphere should be somewhat in focus.

There you have it... I hope user added image


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!