• No results found

Self-Shadowing

In document Shadow Algorithms Data Miner (Page 37-40)

From a computer graphics standpoint, there are typically two main components for determining the shadowing: shadows due to occlusion from other objects and self- shadows. Most of the discussions in this book focus on occlusion from other objects. However, we do want to cover a few essential topics on self-shadowing to allow a more complete understanding of shadowing. Most self-shadowing issues assume the simulation of non-smooth surfaces and relate to (or are considered part of) the illumination computations or the reflection models employed, such as the

ˆ ˆ

N L⋅ check, bump mapping, and advanced reflection models.

1.4.1

N Lˆ ˆ

Check

The simplest example of self-shadowing can be done using a dot product check,

ˆ ˆ

N L⋅ , where Nˆ is the surface normal and Lˆis the light direction with respect to the point to be shaded. This check is done in almost all rendering systems. This means that no light directly reaches the portion of the surface that is facing away from the light without further computations. This also means that direct shading computation and shadowing from other occluding surfaces are only checked when

ˆ ˆ

N L⋅ > o. This is a concept similar to back-face culling from the view direction, except it applies to the lighting direction in this case. While this check is physically correct, natural, and optimal, there are consequences to this check that should be understood, such as specular highlight cutoff and the terminator problem, which are discussed below.

Specular Cutoff

The first consequence comes from bad specular highlight cutoff [640]. Because theN Lˆ ˆ⋅ evaluation also happens to be the diffuse reflection amount and the spec- ular component is calculated independently of the diffuse evaluation, there can be cases whereN Lˆ ˆ⋅ < o, but the specular component is positive, indicating a specular contribution when the diffuse component has no contribution. Thus, the selfshadowing check appears to have prematurely cut off the specular component

(Figure 1.19). This problem is not usually visible due to the unusual circumstances required to encounter this situation.

Terminator Problem

The second consequence comes from the terminator problem. This problem re- sults from improper self-shadowing due to polygonal mesh approximation of a

Figure 1.19. Specular cutoff: the specular reflection component spreads where direct light should not reach because the N Lˆ ˆ⋅ check was not performed.

smooth surface. In Figure 1.20(left), polygons A and B represent polygonal ap- proximations to the smooth surface. At point P on A, the vertex-interpolated normalN ′ˆ is used to compute the illumination as opposed to the plane’s nor- malNˆ . SinceN Lˆ′ ⋅ > oˆ , light contribution is present, and the shadow occlusion from other surfaces must be computed to determine whether P is shadowed. The shadow ray for point P intersects B and incorrectly concludes that P is in self- shadow. This artifact is usually visible as shadow staircasing and is illustrated in

Figure 1.20 (right), where the staircasing occurs between the dark and lit regions. A simple solution [546] is to offset the shadow ray origin by a small amount along

ˆ

N ′to avoid the self-shadowing. Unfortunately, the correct offset value is difficult to figure out, and this offset typically assumes convex region behavior because a

N’ N P B A L tessellated sphere sphere

Figure 1.20. Shadow terminator problem: interpolated normal on the polygonized sphere (left); resulting shadow staircasing (right).

concave region should ideally have a negative offset. Furthermore, although this problem has been described in the context of ray tracing, it is actually a problem in all shadow algorithms, but less so in the shadow depth map and ray tracing algorithms due to the use of bias or offset factor. Further, see Section 2.3.6 for how the various shadow depth map algorithms exhibit the terminator problem. Unfortunately, a workaround has not been made available in the shadow volume approach.

A recent search on the Internet indicates that efforts to improve the terminator problem, without the need for an offset, have been attempted by the Thea render on Blender. Too few details about these attempts are publicly available, although we suspect the solution deals with identification of the silhouette to perform special- case computations and avoid the terminator problem.

1.4.2 Bump Mapping

Another example of the self-shadowing problem is bump mapping [54], where sur- face normals are perturbed to give the impression of a displaced, non-smooth sur- face. Bump mapping does not actually displace the geometry (as in displacement mapping [110]). As a result, shadowing for bump mapped surfaces appears as if the surface is perfectly smooth, because shadow determination does not use the perturbed surface normal information at all.

Techniques such as horizon mapping [391] are used to take into account the self-shadowing effects. See Figure 1.21 as an example of bump maps with and without proper self-shadowing. Please see Section 5.2 for more details on bump- map self-shadowing [391, 435, 538, 294, 238, 179, 439] as well as some advanced bump mapping effects [312, 619, 620, 396, 626, 581, 85]. Also note that some of these techniques have been useful for shadow determination of heightfields (see Section 3.8).

Figure 1.21. Bump-mapped surface without (left) and with self-shadowing (center and right). Image courtesy of Sloan and Cohen [538], ©Eurographics Association 2000. Repro- duced by permission of the Eurographics Association.

1.4.3 Advanced Reflection Models

Direct shading is computed only when the surface is facing light (N Lˆ ˆ⋅ > o) and is not in shadow. However, even under direct illumination, shadowing can occur within the reflection model itself.

When the bumps are smaller and denser over a surface, such that many bumps fit within a pixel, neither the bumps nor the shadows can be perceived. However, the reflection of light behaves differently as bumps cast shadows on some areas and not on others. This phenomenon should be captured by the local reflection model. In advanced reflection models, such as anisotropic reflection models, proper self- shadowing is needed for the correct visual effect. Section 5.3 discusses details on self-shadowing computations needed for advanced reflection models, and related self-shadowing computations with respect to highly complex thin materials can be seen in Section 5.5.

In document Shadow Algorithms Data Miner (Page 37-40)