In the previous recipe, we understood the implementation of PCF. It produces good quality soft shadows. The problem with PCF is that it requires more samples to produce better quality results. In addition, like standard textures, it's impossible to use prefiltered mipmapping to boost the process. Therefore, we must sample multiple texels to average out the resultant to compute the light attenuation on the current texel. The overall process to render the shadow can be slow.
Such drawbacks of PCF can be overcome by using variance shadow mapping. This technique relies on Chebyshev Probabilist Prediction, which makes use of mean and variation. The mean can be simply get from the shadow map texture and the (σ2) variance can be calculated from the average value (E(x)) and the average square value (E(x2)):