Interactive Shadow Generation in Complex Environments Naga K. Govindaraju Brandon Lloyd Sung-Eui Yoon Avneesh Sud Dinesh Manocha University of North Carolina at Chapel Hill {naga,blloyd,sungeui,sud,dm}@cs.unc.edu http://gamma.cs.unc.edu/Shadow Figure 1: The left image shows a snapshot generated from the application of our hybrid shadow generation algorithm to the powerplant model (12.7M triangles). The middle image shows a different viewpoint generated using perspective shadow maps. Notice the aliasing artifacts. The right image highlights the shadows generated by our interactive algorithm from the same viewpoint with sharper boundaries. Abstract: We present a new algorithm for interactive generation of hard-edged, umbral shadows in complex en- vironments with a moving light source. Our algorithm is based on a hybrid approach that combines some of the ef- ficiencies of image-precision techniques along with the im- age quality of object-precision methods. We present inter- active algorithms based on levels-of-detail (LODs) and vis- ibility culling to compute the potential shadow-casters and shadow-receivers. We further reduce their size based on a novel cross-visibility culling algorithm. Finally, we use a combination of shadow polygons and shadow maps to gener- ate shadows. We also present techniques for LOD-selection that eliminate the artifacts in self-shadows. Our algorithm can generate sharp shadow edges and reduce aliasing. We have implemented the algorithm on a three PC system with NVIDIA GeForce-4 cards and applied it to three complex en- vironments composed of millions of triangles. It can render the scene and generate shadows at 7 - 25 frames per second on these models. CR Categories and Subject Descriptors: I.3.3 [Com- puter Graphics]:Picture/Image Generation–Bitmap and framebuffer operations; I.3.7 [Computer Graphics]: Three- Dimensional Graphics and Realism-Color, shading, shadow- ing, and texture Keywords: Shadow generation, object space, image space, visibility, level-of-detail, interactive display, parallel render- ing 1 Introduction The generation of shadows is a classic problem in computer graphics. Shadows provide important spatial cues and can greatly enhance the visual realism of computer-generated images. In this paper, we address the problem of interactive and accurate calculation of hard-edged, umbral shadows cast by a moving point or directional source in complex static en- vironments. These environments may be architectural mod- els, urban datasets, or CAD models of a large structure such as an airplane, oil tanker, or a power plant. These types of scenes may consist of thousands of objects or millions of polygons and can have a wide depth range. The design review and evaluation of complex environ- ments benefits greatly from the ability to generate inter- active walkthroughs. Shadows are helpful in walkthroughs because they provide additional information about an ob- ject’s shape and its relative placement in the environment. [Wanger 1992]. Walkthroughs can further benefit from the use of dynamic light sources. The shifting of shadows caused by a moving light source amplifies the viewer’s understand- ing of the 3D environment. The problem of shadow generation is well-studied in com- puter graphics. Two classes of algorithms have been popular for generation of real-time shadows: shadow maps [Williams 1978] and shadow volumes [Crow 1977]. Shadow mapping is an image-based approach that is easy to use. The trans- formations and depth comparisons necessary to do shadow mapping are available on current graphics hardware. The main drawback of shadow maps is aliased shadow edges due to their limited resolution. Aliasing is especially problem- atic in walkthroughs of large models because the viewer is often very close to the scene geometry while the light source is placed over the head at a distance so as to cover the entire scene (as shown in Fig. 1). Shadow volumes avoid the alias- ing problem by computing object-based shadow boundaries. Shadow volume calculations can be accelerated on graphics hardware using the stencil buffer. Unfortunately, the ap- proach does not scale well for very large models due to the large number of shadow-casters. Main Contributions: We present a new algorithm for in- teractive shadow generation in complex environments. Our algorithm is based on a hybrid approach that combines the image quality of object-precision shadow generation tech- niques with the simplicity and efficiencies of image-precision Interactive Shadow Generation in Complex Environments: UNC-CH TR03-004 Page 1 of 10