PCF stands for percentage-closer filtering. It is a well-known and simple technique to produce smooth shadow edges. The shadow mapping technique implemented in the previous recipe shows very sharp transitions among light and shadow pixels, thereby producing aliasing effects. The PCF technique averages these sharp transitions and results in smoother shadows. Unlike the other texture that provides the capability for texture filtering, which is basically a smoothening method to determine the color of a texture-mapped pixel, unfortunately, such filtering techniques cannot be applied to shadow mapping. Alternatively, multiple comparisons are made per pixels and averaged together.
As the PCF name depicts, it samples the shadow map using the current fragment and compares it with surrounding samples. The rule is to give more weightage to samples closer to the light source. In order words, it calculates the percentage of the area closer to the illuminated surface...