Kram1032 wrote:
What's the difference to simpe gausian bloom?
Is it more accurate? (more physically correct, as you wrote..., but why?)
In the real world, perfect lenses don't focus perfectly. The sharpness of a real lens is limited by diffraction effects of the lens aperture. In fact, very good quality camera lenses are diffraction limited, and are not limited by defects in the shape of the lens. It actually isn't random defects in the lense that limit how tightly a lens can focus; it's a limit that's imposed by the diffraction pattern of the aperture of the lens.
A discussion of diffraction effects in photography:
http://www.cambridgeincolour.com/tutori ... graphy.htm
The new bloom function convolves the image with the Airy disc. The Airy disc function is a closed form function that describes the diffraction pattern of a circular aperture as calculated using the Fraunhoffer diffraction equations. Strictly speaking, this a simplification. This produces the equivalent of Fraunhoffer diffraction effects in the image, when, in fact, more complicated Fresnel diffraction equations might be more appropriate in some cases. But it's a reasonable approximation that's actually correct for sufficiently distant objects (hence "physically motivated", rather than "physically accurate"). A further simplification is that a real difraction pattern is wavelength sensitive, but this implemenation isn't.
A standard test for lens quality is to focus on a bright point light source, and look for the rings of the airy disc in the image. With a very good lens, the airy disc pattern will be visible.
The results speak more than the reasons why I think it works better on a deep level. The simple answer would be: the new function is a reasonable approximation of focusing artifacts in lens systems and the gaussian function isn't.
Informally, here's what I think the main differences are. The current gaussian bloom implementation leaves steep edges around edges of bright lights. Blending the original image with a guassian convolution definitely isn't the right thing to do. Without bloom, you'll notice that severe aliasing (visible pixels) occurs around the edges of bright lights. The blending approach used by the current Gaussian bloom implementation doesn't eliinate the jaggies at all, mostly because the shape of the falloff around the central disk is too steep, I think. Strangely, and interestingly, when using convolution with the Airy disc, the visible pixels go away altogether. I'm not totally sure why this is, but it definitely has something to do with the rate of fall-of around the central disk, and perhaps something to do with the fact the central disk in the Airy disk is relatively wider and flatter than the gaussian function. Also, I think that the airy disk function has a much wider skirt than the gaussian function. I'd guess that (haven't done the math to support this) the Airy disk function falls off at a rate close to 1/(r^2) outside the central disk, whereas the gaussian function falls of at a steeper rate. Since it's the skirt of the function that produces the majority of the bloom effect, this is important. I was surprised how broad the skirts of the airy disk really are. The bloom from a bright light in an image under reasonable approximations of real world conditions actually extends throughout the entire image. In the image shown above, even the darkest pixels end up being +1/256th because of bloom from the light-bulb-like thing in the image.
With the gaussian bloom function, I think what happens is that the fringes are visibly the wrong density. The blend function is required to compensate for this, but blending causes falloff along the borders of the image to be too steep. So, you're caught between the effects of two artifacts: incorrect density of the fringe, or pixelation of the central image.
The advantage of the gaussian bloom (the reason why I didn't remove it) is that it's much faster, and seems to be able to produce passable results when using Reinhard tonemapping (but not when using linear tonemapping). Although both functions are convolved with the original image to produce the output, there's an optimization that can be performed to calculate gaussian bloom that produces results in a fraction of the time required to do the full general image convolution required by the airy disc function.
Based on the limited set of test images I used, gaussian bloom seems to be better with Reinhard tonemapping -- I think, becaues the Reihhard tone mapping has a big effect on the relatively subtle fringes produced by the diffraction-limited zoom; and diffraction-limited bloom definitely produces better results when using linear tonemapping.