Login | Register 

Fast Blurs

Share your components here. First one to 100 wins!

Fast Blurs

Postby keithlostracco » Tue Jan 15, 2019 8:22 pm

Recently I built a bloom system using TD TOPs that worked decently but was a bit slow. So I thought I would rebuild it in C++ to get better performance, but on the path of building the Bloom system from scratch I did some research into different blur algorithms and came across some papers for some pretty fast blurs where you can use much bigger kernels than the standard Gaussian full sampling method with a much lower hit on the GPU.

In the component are 4 blurs:

- the TD Blur for comparison
- a separable 2 pass Gaussian blur using bilinear interpolation and offsets to get close to the actual Gaussian curve with half the samples.
- a Kawase Blur which is a multipass blur that gets closer to Gaussian curve with each pass
- Moving Average blur which uses a moving average algorithm to compute a box blur over multiple passes. Not so great for small blurs but nearly no cost increase with large kernel sizes.

(4.64 MiB) Downloaded 175 times
Posts: 875
Joined: Tue Dec 09, 2008 2:39 pm

Re: Fast Blurs

Postby jmt4zj » Tue Apr 02, 2019 12:22 am

Cheers! Adding blurs to a 21290x1080 canvas and watching my frame rate tank - this will be helpful!
Jonathan Thompson
User avatar
Posts: 149
Joined: Mon Nov 01, 2010 3:15 am
Location: NYC

Re: Fast Blurs

Postby Achim » Tue Apr 02, 2019 2:34 am

Thanks for sharing !

Cologne area TD artists? Let’s get in touch

Posts: 1694
Joined: Wed Nov 14, 2007 1:52 pm
Location: Cologne

Re: Fast Blurs

Postby keithlostracco » Wed Apr 03, 2019 12:09 am

Glad you guys might have a use for it.

One of things I like best about the Bi-linear Gaussian blur in the toe is that all the weights are pre-calculated so you can go from 1 to n samples with no frame drops (as long n samples is small enough for your GPU to main desired fps)
Posts: 875
Joined: Tue Dec 09, 2008 2:39 pm

Re: Fast Blurs

Postby timgerritsen » Thu Apr 04, 2019 5:04 am

Very nice! Thanks for sharing!

Also interesting to see the speed up using texture arrays instead of texture buffers.
I noticed you were sending linear values as second channel in the weightOffsets, so thought
to be smart and only sending a float instead of a vec2 to even create more speed up. Turns out that doesnt really matter :)

Super nice, definitely gonna be using this for gigantic blurs :)

Posts: 67
Joined: Sun Jan 24, 2016 6:57 am

Return to Shared .tox Components

Who is online

Users browsing this forum: No registered users and 4 guests