Graphics Reference
In-Depth Information
There's moreā€¦
If you are familiar with filters, you may have realized already that the
BlurFilterHorizontalCS and BlurFilterVerticalCS methods can
be used to apply any simple convolution filters provided they are separable.
For example, to apply the image sharpening filter using our existing filter methods:
1.
Change the FILTERTAP method to 3 and the BlurKernel declaration to
the following:
static const float BlurKernel[3] = {
-0.3333333, 1.6666666, -0.3333333
};
2. And then run both the horizontal and vertical filters.
Original image on left, sharpened image on right (using lerp with T=2.0)
Implementing a Gaussian blur filter
In this recipe, we use the separability of the Gaussian blur convolution filter to apply a
Gaussian blur in two passes for a vertical and horizontal Gaussian blur.
The Gaussian blur is used in many image processing and 3D graphics operations. The filter
can be used to soften edges, apply blurring during depth of field operations, or for use within
the Bloom lighting technique.
Getting ready
This recipe begins with the completed horizontal and vertical filter compute shaders
and C# code to execute them from the Implementing box blur using separable convolution
filters recipe.
 
Search WWH ::




Custom Search