Book Image

Direct3D Rendering Cookbook

Book Image

Direct3D Rendering Cookbook

Overview of this book

Table of Contents (19 chapters)
Direct3D Rendering Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Further Reading
Index

Implementing box blur using separable convolution filters


So far we have implemented some simple color manipulation techniques. Now we will create an image blur effect using a filter kernel. This technique will make more effective use of the compute shader thread groups by utilizing group shared memory and thread synchronization. Convolution filters can be used to apply a wide range of image processing effects, and among these effects, a number of them are separable, meaning that a 2D filter can be split into two 1D filters: the first representing the horizontal aspect of the filter, and the second representing the filter to be applied to the image vertically. These two 1D filters can then be processed in any order to produce the same result as the original 2D filter; however, the total number of texture reads required is significantly reduced.

How to do it…

Our blur operation will consist of two filters: horizontal and vertical blur filters that will be applied one after the other to produce...