PDA

View Full Version : depth of field


Adam8tor
12-16-2003, 06:05 PM
Fast Depth of Field: using Lightwave and After Effects: this process requires that you render a seperate pass for the depth of field blur, which will be composited.

1. surface everything with the same surface( ex:depth) remember to save them out as a seperate objects.
2. add a null ex:camera focus. This will be where your focus will be the strongest. You can parent the null to the camera to simulate a more realistic focus and move on Z to simulate active focusing of your camera. You could also just have it move freely to keep action in focus.
3. Surface the "depth" surface. color: 255,255,255, diffuse: 0, and a luminousity gradiant, based on distance to object, camera focus null.
4. Adjust the gradiant to fit the desired range of focus. Basically you want to render out an image that has black at 100% focus, and gray to white in areas that will be blurred. You can animate the range by enveloping multiple gradiant layer opacities.
5. Take your render into AE and use it as a luminosity matte for the color render.
6. Precompose and blur to desired distortion, fast blur etc.
7. Put a clean unblurred layer under the blurred comp to accomidate the areas in focus.

Hope this made sense, enjoy.

Adam8tor
01-26-2004, 08:57 PM
Increase rendering speed by killing all lights, and setting the last light to 0 intensity.

codi_apx
01-28-2004, 11:41 PM
If you don't want to use gradient, or you have older version which does not support them, you can use fog. Idea is the same make all objects white without any reflections, specularity or transparency, set background color to black. Use background color fog and set min range and max range to desired values. Render this image, take original one and blured version and mix them using b&w image as a mask. Playing with PS and AE will give you depth of field looking image. This doesn't work when there are transparent objects on scene.

daviddrbal
01-29-2004, 11:44 AM
Originally posted by codi_apx
If you don't want to use gradient, or you have older version which does not support them, you can use fog. Idea is the same make all objects white without any reflections, specularity or transparency, set background color to black. Use background color fog and set min range and max range to desired values. Render this image, take original one and blured version and mix them using b&w image as a mask. Playing with PS and AE will give you depth of field looking image. This doesn't work when there are transparent objects on scene.

Sounds good, but not sure about not working with transparent objects.

Adam8tor
01-29-2004, 04:11 PM
Fog is what I used to use, however it's based on the distance to camera, rather than distance to your null. This doesn't allow you to have a range of focus like a gradiant will. A gradiant will also allow you to do a rack focus by animating the opacity of two different gradiant layers. I think this would work with transparent objects,but after putting the depth surface on you would need to paste back in your transparency setting.

codi_apx
01-29-2004, 09:39 PM
dreamtalks: it doesn't works with transparency, if you take for example glass bottle and focus camera on it, then you will see sharp bottle edges, but through the glass you'll see blured objects in the back. Making mask image you don't use transparency, so on the mask image
"don't know" that this bottle is transparent and you can see something through it.

Adam8tor: You are right, fog is useless when you can use gradients. Gradients has many advantages which fog hasn't. Using fog all objects colser to the camera than the min. fog distance will be sharp, but they shouldn't, they have to be blured the same as the objects behind focal distance. Working with transaprent objects can be made by give different surface to all transparent objects. This surface should have different color on the object edges (sharp edges) and different color in the middle (blured objects seen trough). It's a good idea to use gradient with incidence angle. I didn't tested it yet, but it should give quite good results.

codi_apx
01-29-2004, 10:59 PM
I made a small test, there are 2 images made using 2 masks. I used gradient in the 1st case, and 2 gradients in the 2nd. Difference between this two images is very small, but you can see on the 2nd image objects seen though glass ball are a bit blured and the ball edges are sharp, so it's correct. Surface on the transparent object is two gradients one depends on distance to camera (same gradient on all surfaces) and secound depends on incidence angle. It was very fast and simple test, you can make it looks much better, just play with gradients in the transparent surfaces. Now you see that basic idea of the fake depth of field doesn't works well with transparent objects. I had this problem many years ago with lw 5.0 on my old Amiga, but I couldn't manage with it without gradients. Now i can! :)

CGTalk Moderation
01-16-2006, 10:00 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.