value of zero) while the pixel itself and its 5 remain-
ing neighbors are in shadow (i.e. have a value of one),
then the final percentage for the pixel in the center is
3/9 or 33% in shadow. In our experience, PCF pro-
duces visually satisfying results, but a kernel size of
4× 4 or 5× 5 is required. This increases the number of
taps quadratically since, given a square kernel of size
N, each pixel requires N
2
shadow map references. In
contrast, both of our Gaussian algorithms require 2 N
taps due to the separable nature of a Gaussian kernel.
Variance shadow maps (Donnelly and Lauritzen,
2006) store not just the depth from the point of view
of the light source, but also the depth squared, or sec-
ond moment of the depth value, in a separate channel.
These values are used in the main rendering pass to
compute the mean and variance over a filter region.
Chebychev’s inequality (Theorem 1 and Equation 5
in (Donnelly and Lauritzen, 2006)) is then used to
estimate an upper bound on the percentage of pix-
els in the filter region that are in shadow (the same
value computed by a PCF filter). This ultimately de-
termines the darkness of the penumbra at that pixel
as the light intensity can be scaled by this value. To
avoid sampling all points in the filter region, one can
apply a Poisson disk distribution to choose a small
subset of samples to represent the entire region. One
can also use a pre-filtering technique such as a Gaus-
sian blur for smoother results. It is interesting to note
that very little extra calculation and memory over-
head are required, yet satisfying soft shadows are gen-
erated. This approach works for different types of
lights. The soft shadow results, however, have uni-
form width irrespective of occluder distance or other
contact-hardening criteria.
2.2 Contact-hardening Soft Shadows
(Wyman and Hansen, 2003) use what they call
“penumbra maps” to calculate soft shadows. They
take the typical shadow map approach to generate
depth values from the point of view of the light
source. They then generate a second texture, the
penumbra map, by finding the silhouette edges and
expanding them using cones on the vertices and sheets
connecting these cones along silhouette edges. The
final scene is then rendered using the shadow and
penumbra maps. This approach assumes a spherical
light source, however different light shapes are sup-
ported. Though not described in these terms, this ap-
proach does create contact-hardening results.
Expanding on the PCF approach described above,
the Percentage-Closer Soft Shadow (PCSS) (Fer-
nando, 2005) algorithm creates contact-hardening
shadows by varying the PCF kernel size at each frag-
ment in accordance with the size of the light source
and distance from the occluder. This is similar to our
pcf approach, however PCSS uses the light’s size as
well as a more complex occluder search algorithm.
For our approach, light size is not taken into account
and only occluder distance is used, as obtained from
the original shadow map. We also use an approxima-
tion of occluder-receiver distance.
Since algorithms like PCF and PCSS require many
texture lookups, (Gumbau et al., 2010) describe an
algorithm that uses a separable Gaussian kernel, re-
quiring fewer lookups. They call their approach
Screen Space Soft Shadows (SSSS). Our approaches
are also performed in screen space and the technique
described by SSSS is similar to our single pass Gaus-
sian approach. However in our multi-pass approach,
as mentioned earlier we use a Poisson disk distribu-
tion to reduce the total number of taps to a constant,
kernel size agnostic value. This also allows us to ren-
der the scene once per blur as opposed to twice; once
for horizontal and once for vertical. This further al-
lows us to explore much bigger kernel sizes.
Multi-View Soft Shadowing (MVSS) (Bavoil,
2011) was created by nVidia. This approach uses
multiple shadow maps from different points on an
area light source. These points are chosen using a
Poission disk sampling pattern. For each pixel, each
shadow map is queried and an average over all maps
is taken. This average controls the strength of the
shadow at that pixel. PCF with a constant kernel size
of 2x2 is applied to all shadow map references.
(Klein et al., 2012) use an erosion operator. They
first generate classic hard shadows, then perform edge
detection with a Laplacian kernel. For those pixels
detected to be shadow edges, the occluder and cam-
era distance are stored in separate channels. This in-
formation is then used to calculate penumbra width,
which in turn is used to scale an erosion kernel ap-
plied in the next pass. The final pass can use PCF
with a kernel size also scaled by the penumbra width.
3 ALGORITHM
The main algorithm is described in detail below in text
and pseudocode. We explore three variations: PCF
with a variable-sized kernel, single pass Gaussian blur
with a variable-sized kernel, and a multi-pass Gaus-
sian blur with a fixed or variable-sized kernel with
occluder distance guiding the number of Gaussian
passes performed.
Multi-passGaussianContact-hardeningSoftShadows
275