PDA

View Full Version : Help with depth of field


cwisbg
02-17-2008, 10:52 PM
I need help on depth of field, i know you can render it strait in maya (but it takes forever) so im looking for other ways of achieving the effect. i am using maya and after effect . im supper new to after effects so i dont know where to start there. i know it has something to do with the z depth channel but have tried and tried to get it to work with little success. so my question is how to get depth of field on a maya rendered image with after effects?

L33tace
02-18-2008, 12:14 AM
Depth of Field Generator PRO (http://www.dofpro.com/index.htm)
a Photoshop® compliant plugin capable of delivering high quality, sophisticated Depth of Field and Bokeh effects quickly and efficiently as a post process.

sconlogue
02-18-2008, 01:22 AM
Hey,

There are a number of ways to do it. You could render to RPF/RLA files which allow you to embed a ZDEPTH buffer (Grayscale image indicating the depth in the scene). Then in AE under EFFECTS you would use the 3D Camera Blur effect to use this ZDEPTH buffer. There you would adjust your focul depth and other blur stuff. This is perhaps the most accurate way to go about it. Though I have had trouble with the ZDEPTH buffer acting like its 1 bit with horrible aliasing issues. That was the case in Combustion anyway.

Don't forget, when you render to RPF/RLA you need to enable the channels you intend to export. There are a bunch of channels, like velocity, material ID etc... so be sure to enable the ZDEPTH channel or you'll be out of luck.


Yet another totally different approach would be to use this awesome shader.

http://homepage.mac.com/bauer/portfolio_shaders/zDepthDOF/zDepthDOF.html

He explains it's use so I won't say too much on how to use it. But, basically you create a pass in your 3D app with this mental ray shader. You would just save it out as a jpeg sequence or what ever you like. You would animate all your focus pulling in the 3D app by adjusting varius setting on the shader. It results in a more natural look IMHO.

FBerlim
02-18-2008, 01:59 AM
im supper new to after effects so i dont know where to start there.

Ok... First render your main image (without depth). Render de z-depth in a separate pass. On After Effects, put those two in a comp. Use Lens Blur Effect in the main render. Inside the effect you will see depth map layer. There, choose the z-depth pass. Now you can tweak it until you get the best result.

Very easy and fast blur!!!

cwisbg
02-18-2008, 02:44 AM
ok two things, one how do i embed the channels, i looked through the render globals menu and the only thing i could find is a little check box for the z depth. so if thats all i need to do then ok. second when i render and save the image to rla after effects cant find any depth channel. Another thing, is there a different name for the 3d camera blur because i couldn't find it in the effects menu. Thanks for the help so far.

sconlogue
02-18-2008, 02:08 PM
Right.. I think it is called Lens Blur rather than Camera Blur. It's under the 3D section of the effects list.

Channels...

I am not sure how it works in Maya, but in max to embed or enable the depth channel you select you filename, where to save you render and what file type to output then for some formats like RPF/TIFF/RLA/MOV etc... there is a "setup" button. You click that and you get the options that go with that file type. So for RPF and RLA image sequences you will see a whole bunch of check boxes and you just pick the channels you want. If you don't do that than AE will not see anything but the color channel.

Though I have to say for the fastest blur in AE I would go with compound blur using the depth pass you create with the ZDEPTHDOF shader I linked to above.

You just add both the ZDEPTH pass and Color pass to your comp then apply the compound blur effect to you color pass. The settings are simple, you just have "Source" (what layer to use as your depth) and "Blur Amount". Renders extra fast!

This is two or three times faster than AE Lens blur. It's not as accurate but honestly most of the settings in Camera Blur are overkill anyway. The ZDEPTHDOF shader also gives you a very clear representation of your Z depth and focal length. A regular ZDEPTH only gives you depth and no focal length.

cwisbg
02-19-2008, 12:00 AM
I think that that shader will solve all my problems, however i cant install it. i have maya 8.5 and the latest version on that page is like 6. so i couldnt figure out how to install it.

FBerlim
02-19-2008, 02:48 AM
ok two things, one how do i embed the channels, i looked through the render globals menu and the only thing i could find is a little check box for the z depth. so if thats all i need to do then ok. second when i render and save the image to rla after effects cant find any depth channel. Another thing, is there a different name for the 3d camera blur because i couldn't find it in the effects menu. Thanks for the help so far.

I don't know how to render a separade pass in maya. But you will need have two images. Don't need to embed those images. In fact, is better do that with 2 separated images. Can be any format, tiff, jpg, tga... just be sure you have two images (Main Render and Z-Depth Image). On After, just put those two in a comp. Use "Lens Blur" effect. Forget the 3D câmera, the 3D câmera is to another purpose.

Now. Use Lens Blur on the Main Image (the normal render) Just select the Main Image and do this path. (Effect/Blur & Sharpen/Lens Blur). Inside Lens Blur Effect, change the "depth map layer" to the layer with the image of z-depth. Ok... you can tweak focal lenth until get the blur where you want. You too can increase or decrease the aumont of blur.

Do not forget to put the Main Image above the z-depth image.

Course... is not the best blur ever. Cause is not a raytrace blur. Raytrace blur is very wonderful, or will be, when our computers could handle it better.

You too need to learn how to tweak the z-depth inside maya. So you can get the best result.

OK!!!

cwisbg
02-19-2008, 03:16 AM
ALL right finally got it to work, Thanks. One other thing is their a similar technique for something like fog?

FBerlim
02-19-2008, 12:58 PM
ALL right finally got it to work, Thanks. One other thing is their a similar technique for something like fog?

Yes. You can use the z-depth as a fog. Put the Z-depth Image Layer above the Main Render Layer. Be sure that the far away part of the z-depth image is white. If not... go (Effect/Channel/Invert).

Now click with the right mouse button in the z-depth layer. Go to Blending Mode and change it to, probably, add or multiply.

I think the effect will be too high. You need to decrease opacity.

Then click on the arrow of the layer z-depth. That will open the Transform. Open the arrow of transform.

Or just select the z-depth layer and press T.

Decrease the opacity until get something that you like. You can try others Blending Modes too.

Is aways better to Render your images in separated passes. Difuse, Color, Shadow, ID, Z-depth, Oclusion, Reflect, Refract, Scatter and Radiosity. So you can get the best of your image. To composite with real footage thats the only way to make a very accurated compositing.

Well, any question, i'm here!!!

CGTalk Moderation
02-19-2008, 12:58 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.