The next post processing effect that we will look at is blurring, specifically with what is called a "Gaussian" blur. A Gaussian blur is a blur which, instead of simply calculating a weighted average of a pixel and its neighbors, calculates a weighted average, weighing pixels based on their distance from the center pixel. The weights are calculated according to the Gaussian (or "normal") function:
In normal use of this function, x is the distance from the mean of a data set, and σ is the standard deviation. In this case, x is a pixel's distance from the center pixel and σ is used as a parameter to determine how much the image is blurred. The following graph shows how much a pixel will be weighted as its distance approaches 1, 2, 3, and so on σ's from the center pixel:
The GaussianBlur
post processor is an extension of the basic PostProcessor
class:
We will sample from the input texture 15 times and calculate a weighted...