ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Depth maps and lens blur

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Keiichi Matsuda
Depth maps and lens blur
on Feb 7, 2011 at 4:41:11 am

Right, this was asked by someone else last year but was never resolved, so lets have another go!

Depth maps from 3D programmes (im using C4D) assign luminescence or alpha to distance from the camera. When using this with lens blur, it should be possible to create depth of field on RGB footage of the same scene.
I've modelled a tree in C4D, and I want to make the branches that are closest to the camera blurred. The depth map for this is mostly black, with the branches emerging into white as they approach the camera.

The problem is that while AE correctly reads white as 'blurry', it also reads black as 'in focus', meaning the branches are blurred internally, but have sharp outlines. This is pretty pointless.

I feel this should be easy, as I just want the white bits to be blurred.. but frustratingly I cant find a workaround.

Any tips or sympathisers?


Return to posts index

Keiichi Matsuda
Re: Depth maps and lens blur
on Feb 7, 2011 at 4:48:04 am

by the way, it works fine if I want the background blurred out, and the front branches in focus..
Have also tried setting an adjustment layer with a fast blur on it, with the depth map as a luma matte, but this is still limited by the confines of the white areas (more sharp edges).

Seems ridiculous that the C4D depth pass is unusable in AE..


Return to posts index

Cory Petkovsek
Re: Depth maps and lens blur
on Feb 7, 2011 at 6:46:56 am

That's how it's supposed to work. One end of grey scale (white) blurry, the other end (black) in focus. If your depth matte is not accurate then your settings in C4D are incorrect.

Though you are not asking for it, I suspect you are wanting to know how to have a blurry background, and a blurry foreground and have only the middle in focus. If so, did you properly setup your camera in C4D with a front and back focus planes? Most likely your camera is far sighted, rather than setup with a narrow depth of field. This is evident by your far sighted depth matte. Reconfigure your camera, test it with C4Ds DOF filter to make sure you are getting a blurry front and back. Then you can run your depth pass and you'll likely see white in front and back.

Cory

--
Cory Petkovsek
Corporate Video


Return to posts index


Keiichi Matsuda
Re: Depth maps and lens blur
on Feb 7, 2011 at 7:45:17 am

Hi Cory, thanks for the feedback.

Maybe I didnt explain well enough..
The focus planes are set up correctly, I only need a blurry foreground- here a sample from the depth map:



If i invert the map, it works perfectly well in keeping the foreground in focus, and blurring the background, but this is the opposite to what I'm after.
Problem is that as black='in focus', the edges of the white branches are sharp, instead of blurry as they should be. When this is used in the lens blur, anything inside the white area blurs correctly, but the edge is still crisply defined.

You get me?


Return to posts index

Cory Petkovsek
Re: Depth maps and lens blur
on Feb 7, 2011 at 8:00:39 am
Last Edited By Cory Petkovsek on Nov 5, 2014 at 11:24:06 am

So the only problem is that your depth matte is too sharp? Apply blur directly to the depth matte layer. Then use it as a depth matte.

Cory

--
Corporate Video


Return to posts index

Keiichi Matsuda
Re: Depth maps and lens blur
on Feb 7, 2011 at 8:12:36 am

Its possible to get some kind of result by blurring the depth matte, upping the white levels, then using it as a reference for a lens blur, but it seems a bit of a hacked solution.. I thought there may be a more elegant way to do this.

I thought I might be able to use the depth map as a luma matte for an adjustment layer with a fast blur applied to it, but again the blur stops at the confines of the white bits of the matte (as you would expect, i guess).

Would you say its generally better to render DOF in the 3D app rather than AE?


Return to posts index


Cory Petkovsek
Re: Depth maps and lens blur
on Feb 7, 2011 at 10:18:40 am

I'd rather do it in AE for speed and control over the depth matte, and the ability to turn it off.

The lens blur effect should also give you more of a lens effect with the depth matte, then a fastblur adjustment layer.

http://help.adobe.com/en_US/AfterEffects/9.0/WS3878526689cb91655866c1103a9d...

--
Cory Petkovsek
Corporate Video


Return to posts index

Keiichi Matsuda
Re: Depth maps and lens blur
on Feb 7, 2011 at 10:54:17 am

Yeah me too.. lens blur seems to be good for ramp-based custom mattes, or something with planes angled away from the camera, but not so good for isolated foreground blurs. Thanks for your help, will use that workaround for now!

K


Return to posts index

Darby Edelen
Re: Depth maps and lens blur
on Feb 20, 2011 at 8:11:25 am

This is a limitation of the Lens Blur effect. It is not designed to work with true 3D depth maps. For this post-effect you will either want to try the 3D Channel > Depth of Field effect (which handles depth information better, but uses a cruddy looking blur) or buy this plug-in:

http://www.frischluft.com/lenscare/index.php

It is well worth the cost if you plan on doing this regularly and renders at or above the quality of most 3D applications native DoF blur in a fraction of the time. It supports 32bpc and has a lot of other nifty features as well!

Darby Edelen


Return to posts index


Keiichi Matsuda
Re: Depth maps and lens blur
on Feb 20, 2011 at 9:51:06 pm

Darby,

Thanks for acknowledging the problem, lenscare looks perfect. I've delivered the project already, with some disappointing depth of field effects, but will definitely invest in lenscare if this comes up again.

K


Return to posts index

david nerlich
Re: Depth maps and lens blur
on Jul 7, 2014 at 9:35:31 am

Yeah been playing with this. A few hacks:

Try swapping the background of your z map from black to white or vice versa. The part of your object that blends rather than contrasts with the background is the one that will have nice blurred edges

If you want the middle of the object in focus try making your zmap background grey rather than black or white.

Using an alpha channel on the zmap can help, depending on the situation.



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]