techniques with regards to their suitability for
mobile hardware. A comprehensive literature review
of real-time shadowing is beyond the scope of this
paper, and the reader is directed to various reviews
(Hasenfratz et al. 2003; Bavoil 2008; Scherzer et al.
2011) and books (Eisemann et al. 2011; Woo &
Poulin 2012). Nevertheless, it is convenient to
summarise the basic technique and several
approaches that are suitable for potential
implementation on mobile hardware.
3.1 Basic Hard Shadowing
Shadow mapping was first proposed by Williams in
1978 (Williams, 1978) (differing from shadow
volumes proposed a year earlier (Crow, 1977)), and
the majority of research since that time has focused
on improving the appearance and speed of the basic
shadow mapping technique. Its underlying concept
is to pre-measure the distance from the object to a
light (distobj). When the scene is later rendered to
the screen (from the camera’s perspective), the
distance-to-light of each fragment is measured
(distfrag) and the fragment’s 3D position is re-
projected according to the light’s perspective in
order to recover distobj. If distfrag is greater that
distobj, we know that the object is closer to the light
than the current fragment, and that both positions lie
on the same projection from the light. Thus, the
current fragment is hidden from the light occluded
by the object, and its colour can be modified to make
it appear shadowed.
To implement the basic shadow-mapping
algorithm, the usual approach is to make a first
render pass from the light’s point of view, storing
the depth value of the resulting image as a texture,
termed the shadow map. This is then passed as a
parameter to the second render pass, this time from
the camera’s point of view. The light’s projection
matrices calculate each fragment’s position in the
shadow map, and a texture lookup is done to
calculate the distance to the light. The algorithm
suffers from several problems (e.g. shadow acne,
self-shadowing, shadow map resolution issues)
which must be overcome by introducing external
correction factors (Bavoil, 2008; Sander et al.,
2005).
Hard-shadowing is named so as it creates a
binary classification – each pixel is either occluded
(shadowed) or not. Thus, a characteristic result of
the technique is a jagged, pixelated shadow
boundary, with no smooth variation in shadow
intensity.
3.2 Soft Shadowing
The penumbra, as mentioned above, is the partially
shadowed area that is located at the edge of the
umbra (or hard shadowed area). In 1987, (Reeves et
al., 1987) proposed Percentage Closer Filtering
(PCF). Where simple shadow mapping compares a
single light-depth sample to the depth of the camera
sample, PCF performs several such evaluations in a
small window, or kernel. By averaging the
contribution of the entire kernel to the shadow value
of the central point, it is possible to draw pixels that
appear as partially shadowed (i.e. in penumbra) and
remove the binary appearance of the basic shadow
map technique. PCF has two key parameters:
i) the number of samples in the kernel (typically a
square, and varying from 2x2 up to, for example,
17x17)
ii) the ‘spread’, or distance in between each sample
in the kernel.
If the first parameter grows, the penumbra is
wider, at the cost of hugely increasing the number of
texture reads. The second parameter is commonly
set to the width of a single pixel in the shadow-map
texture; increasing it also widens the penumbra, but
can lead to aliasing effects within the penumbra. To
counteract these effects, the kernel can be
randomized and effectively transformed into a
sample disk (Engel, 2004) which converts the
aliasing effects into a Poisson distribution of noise,
in a disk with the radius of the width of the kernel.
Variance Shadow Mapping (Lauritzen, 2007) is
another soft shadowing technique with fixed
penumbra size. It calculates the variance of the
distribution of shaded pixels, and uses this to
calculate the probability of whether a pixel is in
shadow or not. Its advantage is that the results can
be easily filtered in hardware (for example using
mip-maps) thus relieving the pixel shader of the
requirement to execute any filtering calculations (as
with PCF). Its primary disadvantage is that it is quite
sensitive to the setting of parameters, to the bit-depth
of textures used in its calculation, and to light-
bleeding artefacts (Bavoil, 2008). Other fixed
penumbra solutions include Convolution Shadow
Maps (Annen et al., 2007) and Exponential Shadow
Maps (Annen et al., 2008).
The major disadvantages of fixed-penumbra
methods for shadow filtering are that they do not
attempt to model the real appearance of the
penumbra. The width of the penumbra is not
constant, and can depend on several factors, such as
the width of the light, and the distance between the
occluding surface and receiving surface. Fernando
VariablePenumbraSoftShadowsforMobileDevices
183