Jump to content

creating depth of feild using z-depth mask??


chadsmith
 Share

Recommended Posts

Is there a way to impose depth of field in photoshop using the z-depth greyscale of your image?
Yes. You use an image like this:

FL-Zmap.jpg

(this one made in Lightscape which does not directly produce Z-buffer maps) -- Assuming the map is in exact register as a regular render, you load the grayscale image as an alpha channel and then select it as a mask (technically you would need to invert it, so the whitest part is the farthest away) and then apply your favorite blur. The mask will control the amount of blur (or any other effect you like) applied by the shade value (black = 0%, white = 100%)--in other words, the farther away, the more blur.

Link to comment
Share on other sites

This is a good method and it works well for all sorts of effects when compositing with AfterEffects.

 

One drawback is that you can end up with fuzzy edges on objects with high contrast in the depth map (white over black in EB's example). In this case, there tends to be some bleed depending on the blur (or other effect's) settings and how adjacent pixels are handled.

Link to comment
Share on other sites

  • 1 month later...

Threads like this are the entire reason I love this froum. Good topic guys. I have always wanted to find a quicker way to do this in AfterEffects, and I think you guys hit the nail on the head. I use a similar technique for apllying a glow effect to areas of high contrast, but it does not involve Zbuffer.

Link to comment
Share on other sites

  • 2 weeks later...
Originally posted by Daniel:

If you love such stuff than you should have a look at psd-manager (PSD exporter plug-in for 3ds max and VIZ).

 

I looked at that a while back & if I understand its claims it sounds like a pretty nifty thing. Has anyone here tried it?

 

 

Actually has anyone tried the Ghost Painter 2. from cebas? That looks kind of nifty too.

 

[ June 12, 2003, 09:13 PM: Message edited by: Sawyer ]

Link to comment
Share on other sites

How do you get z buffer maps from LS?

I was sure I had posted HOW to do this somewhere, but I can't find it.

 

The first point is that it is somewhat silly to use Lightscape for this sort of thing since it is not designed to work. I also figures out how to do image-based lighting and to make any object a radient object--but these are things that other rendering programs do as a matter of normal use, not tricks and work-arounds.

 

But here's how to do the Z map:

 

Take any model you are using and save a copy of the .ls file with a new name. You should already have selected views, as Z-maps are view-dependent.

 

Go into your materials and make each material pure white. If it has transparency, leave it alone, just make it white in color. You can either leave any shinyness or bump, or turn all into ideal diffuse--your choice. But remove any intensity mapping and textures (unless you need an alphachannel, but the texture itself should be made all white.

 

Re-set the solution file so that no light has been shot, save. Turn on ambient. Your screen will be all white--using wire-edge mode will make the image readable.

 

The trick is to use the fog function. Set the fog color to black and play with the fog type until you like the result. Remember that at least one of the fog types ramps between the hither and yon clipping distances, so your view should have been set up fairly tight to the model.

 

Render with raytracing and direct, using your saved view files. Remember to use the same rendering method that you used for the regular raytrace--same resolution, and if done in the GUI stick to GUI, if command line stick to that--otherwise you will find the aspect ratios don't agree.

 

Load the Zmap rendering as a layer in Photoshop over the regular rendering and there is your map. Follow the directions earlier in the thread as to how to apply blurs or other effects.

Link to comment
Share on other sites

  • 7 months later...

I know with VIZ, and I would assume with MAX, there is a render elements section in the render dialog box. You choose to render the Z-depth element, and it will create a seperate image from the rendered one that shows the z-depth. I don't remember off the top of my head how to do it, but you also have to imput the distances for near and far depths to your liking.

 

-Chad

Link to comment
Share on other sites

  • 2 years later...

sorry to bring this up again guys, photoshop idiot here. i know that you have to make 2 layers of your render: the original as background and a layer copy which is blurred. i know that the z-buffer image is goin to be used as a layer mask so that it shows both said layers according to its white/grey/black areas. then i stop there. how exactly do i make that z-buffer image become a mask?

 

thanks in advance

Link to comment
Share on other sites

Select the layer that you want to apply the mask to. Then go to the "layer" menu, then choose "add layer mask" then "reveal all."

 

Once you have that done, go to the Channels pallete, and there will be a new channel called "layer 1 mask" or whatever the name of your layer is.

 

Now you can copy the greyscale image and paste it onto the "layer 1 mask" to be used as the mask for that layer.

Link to comment
Share on other sites

exactly the thing that drives me crazy: how do i copy the image to the new channel? i tried pulling it from layers to channels, i tried keyboard shortcuts ctrl+c/ctrl+v, i tried pulling its layer to the layer mask box, there's no copy in the edit menu... i'm obviously missing something here.

 

thanks.

Link to comment
Share on other sites

In PS CS2, you can use the z-depth layer in the new Lens Blur filter.

 

I like how it adds control for blooming of your specular highlights and that you can give it an arbitrary Iris shape to further mimic a real camera.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...