Gaussian blur with large radius

Started by
3 comments, last by Tasaq 10 years, 6 months ago

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?

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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

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?

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.

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

I did it as TheUnnamable suggested.

This topic is closed to new replies.

Advertisement