The Code-Bin
Gauss blur kernel with decimation and bilinear lookups
Posted by: aav | June 20, 2009 @ 6:09pm

C++ Code



Syntax Highlighting





Author Comments
Code for separable gauss blur, generating weights and sample offsets suitable for bilinear lookups. In addition the code keeps to your NUM_WEIGHTS (number of tex2D lookups) by calculating how many times you need to scale-down-by-two first (using StretchRect which is fast).

So you get a nearly artifact free (depending on source image) gaussian blur for a fixed cost of 13 bilinear texture samples and arbitrary blur size.

http://aavdev.blogspot.com
Rating


4.34 / 8
121 Votes