[Bf-committers] Depth of field
Martin Strubel
bf-committers@blender.org
Tue, 15 Jul 2003 16:26:10 +0200
Hi,
just a few comments on the DOF issue:
Matt wrote:
> 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've experimented with sigma correction to fake the DOF with a
postprocess filter (ZBlur) on a normalized (24 bit) image, but I can
tell that this generally never gives good results, if you have sparkling
or shiny (metallic) objects in your scene. So the convolution (blur)
should always happen before the normalization on a non-fully-saturated
float or 16 bit per channel image.
By the way: The convolution is not the one of a gaussian, but the shape
of the iris itself. There should be some stuff around on the web
(keyword 'Fourier Optics') which should explain the backgrounds.
A good example is a night shot through unfocussed, lit rainy glass -
this shows many little profiles of the iris. ('delta peaks' convolved
with iris distribution_func = distribution_func)
Guillermo wrote:
> Hehe, and proper DoF is not just blur either, it is sample
> displacement (the reason you get "hidden" areas that othwerwise do not
> appear). But he does not seem to like the jitter algo, so does not
> matter.
I think in most of the cases you can neglect the lens size (which would
speak for the sampling displacement), unless your focused object is very
near the lens (as in macro mode).
So the plain convolving is quite a bit faster than resampling. But
maybe this could be combined in a 'lazy' fashion to make it fast AND
rather accurate (just pick 4 points from the lens diameter circle,
sample your scene, and combine-convolve.)
Ciao,
- Strubi