Jump to content
  • Advertisement
Sign in to follow this  
Tasaq

Gaussian blur with large radius

This topic is 2114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

I would like to perform a gaussian blur with large radius. I always used kernel size of 7x7 or smaller with two pass method. It satisfied my needs before, but now it's not enough. I am limited to use shader model 2.0, so large kernels are out of the question due to instruction limit. I also want to get the best performance possible. Do you have any sugestions?

Share this post


Link to post
Share on other sites
Advertisement

Two-pass with downsampling is the standard way of handling it with SM2.0 - you just do a standard two-pass blur to a half-sized render target, then two-pass that to another half-sized again RT, and so on, until you get to the kind of blur you want.

 

There is also the option of using hardware filtering to simulate a larger kernel while actually using a smaller one; see http://prideout.net/archive/bloom/ for an example of this.

Share this post


Link to post
Share on other sites

So should I do it this way:

 

1. Blur original image

2. Downsample blured image by half and blur it again

3. Do 2 again for result of 2 and so on

4. Blend all targets with linear sampling

 

If so should I blend it with just averaging or some special weights?

Share this post


Link to post
Share on other sites

You should skip 1. By simply downsampling the image and then stretching it again to screen-res ( or your original res ) adds some bluring to it, although it's not that nice. So you apply a gaussian blur to it and it gets smooth. ( Maybe you want to skip 3 too? )

Hmpf, I guess averaging is a good solution too. If you have the time, I suggest you to try a few techniques that come to your mind, so you can compare them quality- and performance-wise smile.png

 

Edit: Oh, sorry, didn't check the article. In case of bloom, you indeed want to do 3 too. You can do it for a simple blur too, but I think it's too costly since you could do it without looping.

Edited by TheUnnamable

Share this post


Link to post
Share on other sites

Thank You all, I managed to get satisfying results :)

 

I did it as TheUnnamable suggested.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!