Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

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.

cheers
Keith
Attachments
fastBlurs.tox
(4.64 MiB) Downloaded 248 times
keithlostracco
 
Posts: 875
Joined: Tue Dec 09, 2008 2:39 pm

Re: Fast Blurs

Postby pointshader » 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
@pointshader
http://pointshader.com
User avatar
pointshader
 
Posts: 179
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

Achim
 
Posts: 1711
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)
keithlostracco
 
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 :)

cheers,
tim
timgerritsen
 
Posts: 78
Joined: Sun Jan 24, 2016 6:57 am


Return to Shared .tox Components

Who is online

Users browsing this forum: No registered users and 5 guests