Shadow maps use discrete samples in both time and space to compute the visibility of the light on a surface. As a sampling method, it is prone to sampling artifacts. Figure 2.1 illustrates how some of these artifacts can arise when using discrete samples to represent an arbitrary 1D signal. Aliasing is introduced by the initial sampling of the signal when the sampling frequency is too low to capture high frequency details, causing the high frequencies to show up as lower frequency artifacts. Other errors can occur when resampling a sampled signal. Conceptually, resampling reconstructs a piecewise continuous signal from the samples, from which is drawn additional discrete samples. Both the filter used for reconstruction and the resampling frequency can affect the output.
For hard edged shadows, light visibility can be thought of as a piecewise continuous signal whose value is binary, either 0 or 1. Shadow maps do not encode the “visibility signal”
1
⊗
⊗
⊗
⊗
(a) (b) (e) (d) (c) (f) (i) (g) (j) (h) (k) (l)~
Figure 2.1: Resampling a sampled signal. A 1D signal (a) is initially sampled by multiplying by a train of uniformly spaced delta functions (b) with frequency ω0, which is lower than the Nyquist limit for this signal. This produces a discrete, sampled signal (c) which is an aliased version of the original. The sampled signal itself is now band-limited to ω0/2. The signal reconstructed from the sampled signal using an ideal band pass filter is shown with the dashed line. Using nearest-neighbor sampling in effect reconstructs the sampled signal by convolving with a box function that is one sample wide (e). This reconstructed signal (f ) is then resampled at different frequencies. A resampling frequency of ω0/2 (g) is too low and causes aliasing in the resampled signal (j). Resampling at a frequency of ω0 (h) results in a perfect resampling of the sampled signal. Resampling with a frequency of4ω0 (i) introduces high frequency reconstruction errors (k) not present in the original sampled signal. (l) Resampling a perfect reconstruction of the sampled signal at a high resampling rate. directly for each surface. Instead, the binary samples resulting from the shadow map depth comparisons are used to reconstruct the visibility signal. In analogy to the 1D signal example in Figure 2.1, the rendering of the shadow map can be thought of as the initial sampling and the shadow map queries generated during image rendering can be thought of as a resampling. Ultimately, shadow map errors result from using discrete values to represent continuous ones. The following is a list of the different ways in which these errors are manifested:
Initial sampling aliasing: When rendering the shadow map, aliasing errors can occur if geometric features have higher spatial frequency than can be captured by the finite
several square miles. Aliasing leads to strange patterns in the shadows or missing features. The silhouette edges that give rise to hard-edge shadows contain infinitely high frequencies that can never be sampled sufficiently to permit perfect reconstruction.
Resampling errors: When rendering the image, different parts of the shadow map are resampled at different frequencies. For instance, parts of the scene closer to the viewer are resampled at a higher frequency than parts of the scene the are far away. When the resampling frequency does not match the initial sampling frequency, two types of errors can occur:
• Aliasing: High frequency features in the shadow map alias when the resampling frequency is lower than the initial sampling frequency.
• Reconstruction errors: During resampling, the nearest sample in the shadow map is used to estimate the visibility at each queried location. If the resampling frequency is higher than the initial sampling frequency, a number of consecutive queries will use the same shadow map sample resulting in the familiar stair-cased edge artifacts at shadow boundaries (see Figure 1.6). These artifacts are commonly referred to as aliasing, though strictly speaking they may be more accurately de- scribed as reconstruction errors (Glassner, 1995, pg. 344). True aliasing occurs when high frequency energy appears in lower frequencies due to undersampling. These artifacts occur in areas where the resampling oversamples the shadow map (see Figure 2.1). Nearest-neighbor resampling in effect convolves the shadow map with a box function, introducing high frequency edges not originally represented in the shadow map. A perfect reconstruction would produce a smoother, lower frequency signal. This would still not give the correct result but is often preferred to the jagged reconstruction errors because the smooth signal resembles a penum- bra. The smoothing of the signal is actually an initial sampling error instead of a reconstruction error. The sampled signal in the shadow map can be faithfully re- sampled even with nearest-neighbor reconstruction if the initial sampling frequency matches the resampling frequency.
Estimation errors: Because the shadow map is a discrete representation, the visibility for points between samples must be estimated from neighboring samples. When this es- timate is inaccurate, errors can occur. Estimation errors show up as self-shadowing artifacts.
Depth quantization errors: Shadow maps store depth with some finite precision. Even when the shadow map query coincides exactly with a sample, depth quantization can lead to self-shadowing artifacts.
Temporal artifacts: If any of the preceding artifacts are present in an image, they can lead to temporal artifacts when they are not consistent from frame to frame. For instance, aliasing can cause shadows to flicker. The jagged shadow edges from reconstruction errors can appear to “crawl” when the light or objects in the scene move slowly. For quick movements, the effect is less noticeable.
Some of these errors are showed in Figures 2.2 and 2.3. The aim of most of the research in shadow maps since the original algorithm was proposed has been to address these errors. We will now discuss methods proposed to handle initial sampling, resampling, and estimation errors.