This bloom shader looks crappy...

Started by
1 comment, last by johnchapman 12 years, 9 months ago
[font="arial, verdana, tahoma, sans-serif"]
I found this bloom shader on some random site but I can't say it's very impressive though I'm not sure I can do much better. Before I found this shader I was trying to make a blur shader but the effect was very similar to that bloom shader.[/font]

Here is an example:
[attachment=4837:bloom.jpg]


The problem I have with it is the banding where the bloom effect blurs the texture. Would the only way to fix this be to take more samples? If that is the case bloom effects requires a great deal more processing than I thought...
Advertisement

[font="arial, verdana, tahoma, sans-serif"]
I found this bloom shader on some random site but I can't say it's very impressive though I'm not sure I can do much better. Before I found this shader I was trying to make a blur shader but the effect was very similar to that bloom shader.[/font]

Here is an example:
[attachment=4837:bloom.jpg]


The problem I have with it is the banding where the bloom effect blurs the texture. Would the only way to fix this be to take more samples? If that is the case bloom effects requires a great deal more processing than I thought...


All post effects that use blurring tend to require a fair bit of processing, though there's a few things you can try:

Try a separable filter (1st pass blur horizontally, 2nd pass blur vertically, or visa versa). 5 taps on each gives you approximately the quality of 25.

With bilinear filtering, sampling in the corner of 4 pixels allows you to increase the spread of the taps more. Not quite the same as actually sampling all of the pixels and weighting them, but its still a pleasing result.

Jittering the sample pattern differently per pixel (as simple as rotating the pattern based on say, the pixels position) helps break up the noticable pattern where the geometry just looks like its drawn multiple times.

Downsampling the texture you are blurring helps speed up the processing, as you reduce the fillrate.
As DigitalFragment says, there are a number of ways to improve the quality/efficiency of the blur. Getting blur right is 99% of the battle with bloom. Here's a couple of decent links:

http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/

http://prideout.net/archive/bloom/index.php

This topic is closed to new replies.

Advertisement