• No results found

Shadow Culling Algorithms

In document Shadow Algorithms Data Miner (Page 82-84)

2.3 Shadow Depth Maps

2.5.1 Shadow Culling Algorithms

There are many intersection-culling algorithms to accelerate ray tracing, and many have been discussed in detail in other references [198, 526]. Of particular interest for shadow algorithms is the light buffer, hybrid shadow testing, voxel occlusion testing, and conservative shadow depth maps. Most of these algorithms are mainly good for static scenes or offline rendering and are highlighted because parts of their algorithms are also useful for progression towards real-time purposes.

Light Buffer

L

Figure 2.29. The light buffer of a point light source. Each pixel of the light buffer contains a depth-sorted list of encoun- tered objects up to an object producing full occlusion.

The light buffer [219] consists of six grid planes forming a box surrounding the point light source (seeFigure 2.29). Each cell of the buffer contains information on the closest full occlusion from the point light (the closest object that occludes the entire cell) and sorted approximate depth values of candidate occlusion objects that project in the cell. For each point to be shaded, if the depth value of its corre- sponding light buffer cell is greater than the closest full occlusion distance, then the point is in shadow. Otherwise, shadow determination requires intersection tests

with candidate occlusion objects of the cell. They are performed in order with respect to the depth values (starting with the object closest to the point light) until either an intersection hit is found (in shadow) or the depth value of the candidate occluding object is greater than the intersection point (not in shadow). This data structure has been employed in some variation of shadow volume algorithms [537] (Section 2.4.1), radiosity computations [104], and ray tracing soft shadows [407]. Also note that the image in Figure 1.16 is rendered using this light-buffer approach. A ZZ-buffer [494] is a different data structure, but can be used in a very similar fashion to the light buffer to accelerate object intersection with shadow rays. The ZZ-buffer is basically a Z-buffer with each pixel containing pointers to geometry information (geometry that resides in that pixel). Thus, a rasterization step to pop- ulate the ZZ-buffer is done per light; then for each shadow ray, only the objects in the ZZ-buffer’s projected pixel are intersected.

Hybrid Shadow Testing

Hybrid shadow testing [164] uses a voxel data structure to store the shadow poly- gons as invisible surfaces (as in shadow volumes of Section 2.4). The shadow count is updated as the ray traverses the voxels. No shadow rays need to be generated for this scheme, but intersection calculations with the shadow polygons in traversed

voxels are necessary. When the closest intersected surface is found, the shadow count is checked. If the count is 0, then the surface is not in shadow; otherwise the surface is in shadow. However, since it might need to deal with a large num- ber of shadow polygons, the implementation resorts to the traditional shadow ray approach under such circumstances.

Voxel Occlusion Testing

For voxel occlusion testing [638], each voxel uses up an extra 2 bits per light source. Its value indicates the level of opaque occlusion of the voxel with respect to each light source: full occlusion, null occlusion, and unknown occlusion (see Figure 2.30). The shadow umbra of all objects is scan-converted into the voxel oc- clusion bits, such that if the voxel entirely resides inside or outside the shadow um- bra, then the voxel occlusion value is full or null occlusion, respectively. If the voxel contains the boundary of the shadow umbra, then it is marked with unknown oc- clusion. When the viewing ray intersects an object in a voxel that has either full or null occlusion, then any intersected object in the voxel must be in shadow, and no shadow rays need to be generated. If unknown occlusion is found instead, then the fastest method of shadow determination is to resort back to voxel traversal of the shadow ray. However, as each voxel is traversed, its occlusion value is checked—a quick exit condition for the shadow ray traversal is available if any of those tra- versed voxels show a full or null occlusion value, which will again mean that the point to be shaded is fully shadowed or fully lit, respectively.

The objective of this approach is to get known occlusion status as often as possi- ble, and thus for polygonal meshes, it is best to preprocess voxel occlusion testing with the per-mesh silhouette optimizations described in Section 2.4.3 instead of processing on a per-polygon basis.

For interactive applications, a high enough voxel resolution may be used to reduce the occurrence of unknown occluded voxels, or it can be used to en- code only totally occluded or unoccluded voxels [650, 503] (Sections 3.7.4 and 2.6,

L

voxels in full occlusion voxels in null occlusion voxels in unknown occlusion occluder

Figure 2.30.In voxel occlusion testing, each voxel of the regular grid is marked as full, null, or unknown occlusion from one light source.

respectively). Such an encoding can also lead to the ability to generate atmospheric shadows as well (Section 5.6.1).

An alternative but similar optimization is introduced by Djeu et al. [133]. Ob- jects are assumed to be closed and totally opaque. An interior fill operation of the objects is done to fill up the k-d tree. When computing shadows, the shadow ray traverses the k-d tree, but instead of first intersecting the mesh, the shadow ray first tries to locate filled regions. If a filled region is found, then it is in shadow. If a filled region is not found, then costly intersection calculations with the mesh are needed, but this is usually only required at the silhouette of the object (from the perspective of the light).

Conservative Shadow Depth Maps

A couple of independent papers [337, 243] make the observation that shadow depth maps usually provide a decent approximation to the shadowing occlusion and can be used as a first pass to avoid shooting lots of shadow rays (in the standard case) and to make the final quality higher. The shadow depth maps created in the first pass tend to be more conservative, to cover cases where the shadow occlusion is uncertain. Whether or not to shoot a shadow ray is determined on a view-pixel basis—these shadow rays are often needed at the silhouette of the geometry.

The above two papers differ in their approaches for determining which pixels need to shoot a shadow ray. Hertel et al. [243] store in the shadow depth map the minimum z-value of the entire coverage of triangles in the shadow depth map pixel. A check is also done if the shadow depth map pixel is entirely covered. If entirely covered, then the shadow-ray origin compared to the shadow depth map pixel z-value can determine whether the point is in shadow or lit without shooting a shadow ray. Otherwise, a shadow ray is shot, but traversal of the shadow ray does not need to go beyond the shadow depth map pixel z-value (i.e., early ray termination).

Lauterback et al. [337] tag each shadow depth map pixel as requiring a shadow ray to be shot if the Z-depth pixel differs significantly from the neighboring Z- depth pixels. In essence, it is tagging the silhouette to discover the need for a shadow ray.

Both papers test their approaches on the GPU. It is unclear how effective the algorithms would be when insufficient shadow depth map resolution occurs.

In document Shadow Algorithms Data Miner (Page 82-84)