View Full Version : Setting focal distance with z-depth output
DizzyJ 10-10-2006, 03:20 PM I want to render out a longish animation and am planning on doing the DOF in post. However, I don't know how to control the focus point in in the z-depth output. I'll be compositing in AE 7.0 (Mac)*, which I don't know well and (unless I'm convinced otherwise) will use lens blur for my DOF effect. Lens blur requires that you set the focal distance, but that will change during the course of the animation. I've seen a number of tutorials on how to use DOF with AE, but not how to control the focal distance.
Thanks
* I have a friend who has Shake, but has just started to learn it. If this would be much easier to do in Shake, I could compsite there.
| |
mindsample
10-10-2006, 04:16 PM
you control it by chosing which greyscale value is the centre of your focus, and both darker and brighter values will get increasingly blurred. The process is the same in both shake and AE.
To animate the focal point of a camera I suggest you link a distance tool to your focal length, point constrain one end to your camera and use the other end to "set" your focal point. If you dont want to use a z-channel you can just project a gradient onto your scene, using the centre of your focal point (i.e. your one end of the distance measure tool) as absolute white, with falloffs from the centre into black.
Use 16bit or floating point renders for sufficient levels.
DizzyJ
10-10-2006, 04:38 PM
Thanks!
If I link a distance tool as you describe, will the greypoint be constant at that point throughout the animation, or does Maya calculate z-depth as a gradient from the camera min/max crop distances?
Also, the gradient technique seams perhaps more intuitive. Is that done via a material override? I've never worked with (or heard of) a gradient overlay.
mindsample
10-10-2006, 04:47 PM
Thanks!
If I link a distance tool as you describe, will the greypoint be constant at that point throughout the animation, or does Maya calculate z-depth as a gradient from the camera min/max crop distances?
If you link the focal length with the output of the distance tool you wont get a gradient, you will simply render a depth of field operation on top of you render based on your camera and render settings. I just gave you this example as an option to not do it in compositing.
Also, the gradient technique seams perhaps more intuitive. Is that done via a material override? I've never worked with (or heard of) a gradient overlay.
It is the technique we use constantly at work. Basically create a new render layer, apply a surface shader to all the objects and then attach a gradient via projection to the color channel of the surface shader. Project the gradient along Y, with black being close to the camera and white being the furthest point from the camera.
Now you only have to play with the texture node and the gradient to adjust the settings. Obviously the node can be animated, i.e. be moved in relation to your camera, be constrained to your camera-aim or measure tools, it basically gives you a lot of freedom.
DizzyJ
10-10-2006, 04:57 PM
Thanks again. The gradient technique seems simple and powerful. I'll give that a go.
CGTalk Moderation
10-10-2006, 04:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2009, Jelsoft Enterprises Ltd.