• No results found

Error over all light directions

In document Logarithmic perspective shadow maps (Page 126-129)

5.2 Frustum parameterization

5.2.2 Error over all light directions

Figure 5.28 shows the error distribution over varying light directions for frustum parameter- izations. A standard shadow map using a uniform parameterization shows little variation. The variation usingFp is less than that of Flp. The graph of the error for Fp relative toFlp shows that while the error is roughly the same forγ <30◦, the error ofFp is much higher for γ >30◦. The variation in error is greatly reduced for low fe/ne ratios.

5.2.2.1 Using pseudo-γ for Flp

The error distribution for Flp shows small islands of higher error near γ = 30◦. The error is mostly concentrated inRs. When the light direction crosses through these regions, the abrupt change in shadow quality can be quite noticeable (see Figure 5.29). Figure 5.30 shows how the problem occurs. Because of the way the view frustum is rotated for this light direction, vertices from the far face have dipped below the eye location. This situation is similar to the γ < θ case illustrated in Figure 5.24. According to our analysis, the warping should be

1

Figure 5.28: Error distribution for frustum parameterizations over varying light directions. These graphs show the error in terms of the storage factor for a frustum pa- rameterized with Fun (top-left), Fp (top-middle and bottom-middle) and Flp (top-right and bottom-right). γz is the angle between the light direction and the view direction and γx is

the azimuthal angle measured from the x-axis in eye space. The minimum error value is normalized to 1 to highlight the variation in error. We have used our shaping function for the warping parameter for Fp and Flp. The frustum parameters arene = 1, fe= 1000, and θ= 30◦, except for (bottom-middle)where fe = 10. (Bottom-left)shows the error of Fp rel-

ative to Flp using a log2 scale. (Top-right) Arrows highlight small islands of relatively higher error. (Bottom-right)Using the pseudo-γ,γp, in place ofγz removes these islands but causes

higher error around γz = 30◦.

relatively weak for this case, resulting in a nearly uniform parameterization. However, γ is actually greater thanθ, so the warping is still fairly strong, leading to high error. One way to avoid this problem is to define a pseudo-γ, γp, that behaves like γ for light directions in theyz plane, but is defined in terms of the position of the eye relative to the extents of the far face. From Figure 5.30 we can see thatd0 =fetanγ andd1=fetanθ. By the properties of similar triangles,d00/d01=d0/d1. From this we can conclude that:

γ = tan−1 d0 0 d01 tanθ . (5.77)

Figure 5.29: Problem case for Flp. (Top row) A small change inγ causes a large change

in error. Grid lines for every 10 shadow map texels are shown. On the left, the error is fairly evenly distributed across the view frustum, as can be seen on the ledge in the foreground and the building in the background. In the middle, the error becomes very large in the s direction for γ θ. This is because the warping is too strong. Resolution redistribution has been disabled in these images to highlight this effect. On the right, the warping quickly falls off with a few more degrees of rotation, restoring the high quality in the background and causing higher error in the foreground. (Bottom row) Using pseudo-γ instead of γ with our warping parameter shaping function removes this problem at the expense of higher error in the foreground forγ θ caused by a faster falloff in the warping.

If we defined0

0 =ve−vf0 andd01= (vf1−vf0)/2, wherevf0 and vf1 define the extents of the

far face projected onto the light image plane, we can compute our pseudo-γ as:

γp = tan−1 |ve−vf0| vf1−vf0 tanθ . (5.78)

The absolute value is needed to make γp valid over all light directions. If the light direction lies in theyz plane, thenγp =γ. Otherwiseγp > γand usingγp in place ofγ in the warping parameter shaping function causes the transition to the uniform parameterization to occur slightly sooner, thus eliminating the islands of higher error (see Figure 5.28 and Figure 5.29).

1 v e v f 0 v f 1 θ γ γ d 0 0 d 0 1 fe d0 d1 light eye

Figure 5.30: Frustum in problem case for Flp. (Left) The view frustum as seen from a

directional light. The warping is too strong in the top image leading to high error. The bottom image uses a pseudo-γ to compute the warping parameter value. (Right) The view frustum for a directional light in the yz plane. These quantities are used to compute the pseudo-γ in terms of the position on the light image plane of the eye pointve relative to the extents of the

far facevf0 andvf1 rather than the actual angle between the light and view directions γ.

In document Logarithmic perspective shadow maps (Page 126-129)