Sign in to follow this  
SteveDeFacto

This bloom shader looks crappy...

Recommended Posts

SteveDeFacto    109
[font="arial, verdana, tahoma, sans-serif"][size="2"]
I found [url="http://www.coniserver.net/wiki/index.php/Bloom"]this[/url] 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.[/size][/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...

Share this post


Link to post
Share on other sites
Digitalfragment    1504
[quote name='SteveDeFacto' timestamp='1313014385' post='4847365']
[font="arial, verdana, tahoma, sans-serif"][size="2"]
I found [url="http://www.coniserver.net/wiki/index.php/Bloom"]this[/url] 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.[/size][/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...
[/quote]

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.

Share this post


Link to post
Share on other sites
johnchapman    601
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:

[url="http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/"]http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/[/url]

[url="http://prideout.net/archive/bloom/index.php"]http://prideout.net/archive/bloom/index.php[/url]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this