I have read many articles mentioning that kawase blur performs better than box blur…
I found that unrealbloompass has a serious blocky feel in many cases. This should be a problem with the blur algorithm, right?
There are a number of factors that affect the blockiness that you can tweak… and some that reduce the artifacting. Also you have to make sure that you’re properly resizing the composer when your display resizes (and at init time)
https://threejs.org/examples/webgl_postprocessing_unreal_bloom.html
I don’t notice much/any blockiness in that sample ^ but I have seen it happen.
r.e. Kawase blur:
From gpt4:
Kawase blur and separable convolution 2-pass Gaussian blur are both techniques used in graphics programming, but they have distinct differences in how they approach blurring an image.
- Kawase Blur:
- Method: Kawase blur is a technique that was popularized by Masaki Kawase for use in the game “Love-de-Lic”. It uses a series of iterations of box blurs to approximate a Gaussian blur. This method involves sampling pixels in a pattern that expands in each iteration, creating a blur effect that resembles a Gaussian blur but is computationally more efficient.
- Performance: It is generally faster, especially for larger blur radii, because it requires fewer texture samples per pass.
- Quality: The result is an approximation of a Gaussian blur. It can produce artifacts more noticeable than Gaussian blur, especially at high blur levels.
- Separable Convolution 2-Pass Gaussian Blur:
- Method: A true Gaussian blur uses a kernel that represents the Gaussian function. The separable convolution technique splits this into two passes - horizontal and vertical. This separation reduces the computational complexity significantly.
- Performance: It’s slower than Kawase blur for large blur radii because it requires more texture samples, but it’s still more efficient than a non-separable Gaussian blur.
- Quality: Provides a true Gaussian blur, which is generally smoother and without the artifacts that can be present in approximations like Kawase blur.
In summary, Kawase blur is a more performance-oriented technique that approximates Gaussian blur with fewer texture samples and faster computations, particularly beneficial for real-time applications like games. In contrast, the separable convolution 2-pass Gaussian blur provides a higher-quality true Gaussian blur at the cost of more texture samples and computational resources. Your choice between them would depend on the specific requirements of your graphics or game programming project in terms of performance and visual fidelity.
Due to the central limit theorem, all of these algorithms approach one another to the point of indistinguishability when you have sufficient passes or samples. There’s nothing really like “this one is faster but looks ugly.” Rather, there’s no free lunch. Cost of sampling versus cost of additional passes versus other overhead versus a host of other tangible and intangible benefits and detriments. There’s no best algorithm. Different algorithms excel in different cases.
Doesn’t that miss the point of the 2 pass gaussian though? The second pass is sampling the already blurred first pass, so it’s like getting more samples for free… vs a single pass that has to blur every sample in both axes, from scratch.
There’s no such thing as free. With the separable solution you save on samples but more passes means more overhead and draw calls. With a large gaussian blur kernel, that’s almost always a tradeoff you want to make. But you probably aren’t using a pure gaussian solution, separable or otherwise, if you’re at all performance sensitive.
Hmm… I’ve been using the unrealbloom in a lot of apps for a while now. I love it!
and it seems to work pretty well. I haven’t had any major issues.
https://manthrax.github.io/mcade/
https://manthrax.github.io/logiclab/index.html
Do you have any kawase examples?