JoeyDeVries / LearnOpenGL

Code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com
https://learnopengl.com
Other
11.01k stars 2.8k forks source link

PBR Bloom: clarify that bloom happens due to diffraction, not scattering. #371

Open wrightwriter opened 1 year ago

wrightwriter commented 1 year ago

Bloom occurs due to light with high amplitude entering an aperture, then, because of the wave-like nature of light, diffracting and producing interference patterns. An Point Spread Function is what occurs when you photograph a small bright light. If you convolve a point spread function image with an input image, you can approximate bloom. The reason we are choosing to convolve with a gaussian, is that a gaussian is cheap to compute using this method.

I also think it's very worth explaining in a couple of sentences why convolving with kernels produced with FFT Bloom is way more physically based, and also link resources for people interested.

JoeyDeVries commented 1 year ago

@alexpanter

wrightwriter commented 1 year ago

I'm up for writing an edit (while also reading up more to make sure it's correct)

alexpanter commented 1 year ago

@wrightwriter Thank you for bringing this to our attention!

I think it would certainly be great if you'd write something, as you clearly know more about this than I do.

I have actually been wanting to write a follow-up tutorial on convolutional bloom, because it probably deserves its own page. But realistically I'm a bit too busy to get it done rn..

But we could write an addendum to the article at the end or something, and then potentially move it to its own article if and when we decide to do so - what do you think?

There are some things that I would like to mention: 1) AngeTheGreat has a fantastic video on Youtube about bloom from a more scientific point-of-view 2) A mention about the solution in Unreal Engine would be relevant as well.

Personally, I think the progressive downsampled Gaussian blur was implemented as a fix for the broken single-downsampling horizontal+vertical blur which honestly looks atrocious :). But the end-game for bloom is certainly FFT, I agree on that.

Let me know what you think! I'm up for collaboration on this.

Best, Alexander