[Bf-committers] Depth of field

Matt Ebb bf-committers@blender.org
Mon, 14 Jul 2003 17:19:59 +1000


Hi

> Between these two objects, everything would be sharp. Before or after them,
> progressively blurred. 


> I still have to implement my "distances buffer", wich will give me the
> percentage of blur I should give to a pixel.

Will these calculations be taking place on floating point data? or on 24bit RGB
data? This will also affect the distance to blur a pixel - using a gaussian blur
on HDR/floating point/etc images will replicate the blur effect accurately
(intensely exposed areas will blur out larger and stronger than dark areas) - if
it's just 24bit, maybe it's possible to hack it with some sort of gamma
correction technique...

> I have also begun to work on buttons on the camera edit button screen. There
> will be
> two choices: either use a front and a back distance, both fix values, to
> specify where
> it should be sharp, where it should be blurred, or use a front and a back
> object.
> Between these two objects, everything would be sharp. Before or after them,
> progressively blurred.

DOF doesn't just work by progressively blurring along a linear scale. The
overlapping 'circles of confusion' converge over an initially steep curve, and
then flatten out in a logarithmic-looking curve after the focus point. There are
some good graphs that explain this process for different f-stops etc. here:
http://www.renderman.org/RMR/Examples/dof/

An alterative to these 'front distance/back distance' settings is to use an
'aperture' setting. We already have a 'lens' (focal length) button for the
camera, so the DOF could be derived from the aperture, focal length and shutter
speed (FPS?).

Here's a buch of links I googled up with formulas etc. for calculating the
amount of DOF blur through a lens:

http://www.outsight.com/hyperfocal.html
http://www.photo.net/learn/optics/lensFAQ
http://www.photo.net/bboard/q-and-a-fetch-msg?msg_id=001nuN

Cheers

Matt