View Full Version : Depth of field. Focus distance. What am I doing wrong?

10-24-2006, 10:01 AM

Here is an image of some hills. I've rendered it around 100 times, each time changing the depth of field, focus distance and f-stop setting, and everytime, EVERY SINGLE time, it comes out looking exactly the same. ARGH!!?!

Please, if anyone else has had this problem or knows what I might be doing wrong, I would be most grateful for any help.

10-24-2006, 10:02 AM
I'm trying to have the focus on the hill in the background, whilst the foreground is completely blurred btw.

Captain Obvious
10-24-2006, 10:30 AM
Are the hills modeled to scale? Then you won't get much depth-of-field. It's scale-dependant.

10-24-2006, 10:33 AM
I've tried this with many different objects, and changing the sizes. I made these hills 45km x 45km.

10-24-2006, 10:52 AM
I don't think you will get DOF with mountains.. but you could force it..
adjust the focal distance then change the F-stop from 4 to 0.5 and even lower depending on the scale of your object. try 0.05,etc..
see which ones work best.

don't forget to press shift+F9 to preview DOF in openGL

10-24-2006, 11:10 AM
I'm using LW 7.5, so no DOF preview. DOF should still be working though, and I've also tried digital confusion with no luck.

10-24-2006, 11:24 AM
Or you could render out a depth pass and do it in post. Probably not the answer you want, but that's how I do it. My plugin of choice is iDof (http://www.lwidof.net/iDof/News/News.html). The amount of choice in post that you get is wonderful.


10-24-2006, 11:52 AM
yeah, depending on the scale of the mountains you may need to drop your f-stop really small. I've had to go as low as .005 before to get some DOF.

Captain Obvious
10-24-2006, 12:23 PM
Why on God's green earth would you want depth-of-field on mountains, though?

10-24-2006, 12:45 PM
Maybe It's a very special camera.

10-24-2006, 01:15 PM
Hello maybe you could post a sample scene that we can take a look at? Also what OS and version of LightWave are you using.

10-25-2006, 02:19 AM
Or they're tiny mountains :)

Make sure you're using medium anti-aliasing or higher.

I'm using LW 7.5, so no DOF preview.
7.5 is when it was introduced!

10-25-2006, 03:06 AM
Or they're tiny mountains :)
Then they shouldn't be modeled at 45km x 45km. ;)

That is precisely the reason he's not getting DOF blur. The scales in question mean that, realistically, you would need a camera with a ridiculously large aperture to see any, as others have mentioned doing.

Dave Jerrard
10-25-2006, 05:11 PM
Maybe It's a very special camera.
A very huge camera! :)

Ah, Weepul beat me to it.

Just do a search for Depth Of Field in Goolge. There's a lot of pages that deal with this, like this one (http://www.cambridgeincolour.com/tutorials/depth-of-field.htm).

DOF is directly controlled by the size of the aperture in a lens (http://www.mir.com.my/rb/photography/fototech/htmls/depth.html). The larger the aperture, the shallower the DOF effect - meaning more blurring in front and behind the focus distance. The smaller the aperture, the sharper everything gets. But size of the aperture is only half the issue, the other half is distance. The closer you get to the lens, the less depth of field you'll get. DOF is related to parallax. You can get an idea of it using just your own eyes...

You eyes are approximately 60mm apart. When you look at your finger, or anything close, they both converge on the same point, but anything closer or farther will appear to split into two images, and this happens almost immediately before & after the focal point. Now look at something several feet away. The two lines of sight converge at a more acute angle, so objects near the focale point don't diverge as noticeably. When you look at something a mile or more distant, your eye-lines are nearly parallel, and nothing at this distance appears to split, though much closer objects, like you hand definitely. This example is a simplified version of what a camera lens does, in this case, it would be a lens with an aperture of 60mm in diameter. The only difference is that we're only looking a how light travels through to points on opposite sides of the lense, where a real lens has light coming through it across the entire surface, and each point on the lens the view from a slightly different location. The larger this area, the more diverse the the viewing angles.

Close one eye and look at the same things. Nearby objects will have a pretty shallow DOF but they won't blur anywhere near as much as the two image would diverge when you viewed them with two eyes. After several feet, your eyes, any DOF blurring isn't even noticeable (assuming you have good eyes or have corrective lenses). A car across the street will be as sharp as a car a couple blocks away. Now you're looking at everything through an aperture of about 4mm.

Theoretically, a pinhole camera (http://en.wikipedia.org/wiki/Pinhole_camera) is the perfect lens - it keeps everything in sharp focus regardless of distance. The reasons it's not a perfect lens is that as the aperture gets smaller, less light gets through the lens. In photography, as you increase the f-stop values, you lower the amount of light by half for each step. To compensate, you either increase the exposure time, or the increase the light in the scene.

Area lights work in the reverse direction, and give a good example. If you place a large area light over several small objects, they'll all have very soft shadows. The penumbra (http://en.wikipedia.org/wiki/Penumbra) of these shadows shows how much that surface would be blurred if a lens the same sizeand position of the area light was focussed on the object casting the shadow. Make the area light smaller and the shadows will sharpen, until you have a point light, where all shadows are sharp no matter how far they're cast.

For the Hill scene, place an area light inthe camera's location and play with it's size until you see the hill shadows start to blur more. Now look at the size of the light. If those hills are real-world scale, then that light's going to be pretty large. This is about how big the film plane in the camera will have to be to get a blur of about the same amount.

Why film plane? A lens needs a certain amount of space between it and the film in order to project an image onto it have it in focus. This is the Focal Length of the lens, and different lenses have different focal lengths. A closer focal length will project more of the image onto the film plane, giving a wide angle, while a longer focal length will magnify the image, giving a telephoto effect. I don't know of any lens that can do this in less space than the diameter of the lens itself, so the lens needs to have a focal length of at least 1x it's aperture. This is what those F-stop numbers are - they're ratios betweent eh focal lenght of the lens and the size of the aperture. f2.0 would be a lens that has a focal length that's 2 times the diameter of the aperture. The widest aperture I've ever seen was a 50mm f/1.2, which means the focal length was only 1.2 times the aperture size.

This doesn't matter how big the lens or the film plane are - it's all relative. So if you have a film plane that's about 1 meter across, you're going to need a pretty large lens to project an image onto it. So the aperture will get big too.

Since this is all relative, you'd get the same DOF if you had a regular sized camera and shrunk your hills proportionally, and this is where DOF bites so many people. Too much DOF makes your scenes look like miniatures. The worst offender I've seen so far is a scene in BSG that had a camera moving with missiles, keeping them in focus, while the Galactica that was behind them was severely out of focus. I worked it out based on the Galactica being about 2000' long that to get that kind of DOF, the camera plane had to be about 200 feet! Either that, or it was a model that was only a couple inches long, which is how it feels every time I see that shot - I keep thinking it's some kind of hologram at first, but it's not. Whoops!

People tend to over-do DOF and the result is everything looks small. f-stop values of 1 or lower should not be used (except in extreme cases of artistic license) because they describe impossible lenses. If you're going for realism, sublety is key.

He Who Tried To Avoid Going Technical, Really.

10-25-2006, 07:17 PM
@dave jerrard
best explanation ever.

08-03-2007, 08:01 AM
the depth of field not working if you not use NULL !!
exept if use an pluggin, like digital confusion for example,
(excuseme me inglish)

08-03-2007, 08:09 AM
Maybe It's a very special camera.

A tilt shift lens would do it :D