
Efficient Shadows for GPU-based Volume Raycasting Timo Ropinski Jens Kasten Klaus Hinrichs Department of Computer Science University of Münster Einsteinstraße 62 48149 Münster, Germany {ropinski, j_kast03, khh}@math.uni-muenster.de ABSTRACT GPU-based raycasting has emerged as the defacto standard for interactive volume rendering on off-the-shelf graphics hardware. Even though in theory this technique can be easily extended by shadow feelers in order to support shadows, this obvious approach has a major impact on the rendering performance. In this paper we will investigate shadowing extensions for GPU- based volume raycasting and compare them with respect to their quality and their performance. In particular, we will consider shadow rays, shadow mapping and deep shadow maps. For these techniques we will address their implementations using current graphics boards, and we will compare their visual results as well as their runtime behavior. Keywords Volume Rendering, Shadow Generation, Shadow Mapping, Deep Shadow Maps. 1 INTRODUCTION ferent algorithms have been proposed for slice-based Volume rendering has evolved into a mature area of volume rendering [KPHE02], we will concentrate on computer graphics. Many domains such as medical techniques suitable to integrate shadows in GPU-based acquisition or seismic sonography techniques produce volume raycasters [KW03], since GPU-based volume volumetric data sets which have to be explored inter- raycasting has emerged as the state-of-the-art volume actively. Besides an immediate visual feedback also rendering technique which is found in most recent vol- good perception of the spatial relationships is impor- ume rendering frameworks. While the benefits of GPU- tant. It has been shown that the used lighting model has based raycasting include an easy as well as flexible im- a major impact on the spatial comprehension [LB00]. plementation, it is also often stated that GPU-based ray- Besides diffuse interreflections also shadows serve as casting allows an easy integration of shadowing effects. an important depth cue [SSMK05]. While volume ren- However, while the brute force approach for shadows dering techniques developed in recent years mainly had can be truly considered as easy to integrate, it is not effi- the goal to achieve interactive frame rates, the objec- cient at all. In fact, it is just an adaptation of the shadow tive of realistic renderings has been neglected. Now feeler rays known from conventional raytracers, with that interactive volume rendering is possible on stan- all their downsides. To provide the reader with a more dard graphics hardware [KW03] it is time to strive detailed knowledge about shadows in volume render- for producing more realistic images in order to sup- ing, this paper reviews different shadow algorithms and port better spatial comprehension. In this paper we their implementations in the context of GPU-based vol- focus on shadow algorithms which can be integrated ume raycasting. In particular we will compare the brute into volume rendering in order to provide additional force approach, i.e., casting of shadow rays, with a depth cues (see Figure 1). We consider in particu- shadow mapping technique for GPU-based raycasting lar those algorithms and implementations which have as well as deep shadow maps. the potential to permit interactive shadowing. How- The remainder of this paper is structured as follows. ever, for efficient shadow generation it is important to In Section 2 we will discuss related work regard- adapt the used techniques to the volume rendering tech- ing shadow generation by specifically addressing niques exploited for image generation. Although dif- algorithms suitable for interactive volume rendering. In Section 3 our implementations of the shadow Permission to make digital or hard copies of all or part of algorithms are discussed, and they are compared in this work for personal or classroom use is granted without Section 4. The paper concludes in Section 5 by giving fee provided that copies are not made or distributed for some overview over future work. profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute 2 RELATED WORK to lists, requires prior specific permission and/or a fee. The underlying GPU-based volume raycasting tech- Copyright UNION Agency – Science Press, Plzen, Czech nique, in the following called GPU-based raycasting, Republic has been introduced by Roettger et al. [RGWE03]. WSCG2008 Full papers 17 ISBN 978-86943-15-2 stack of shadow maps, which store alpha values instead of depth values in each shadow map [KN01]. A more compact representation for semi-transparent occluders are deep shadow maps [LV00]. The used data structure consists also of a stack of textures, but in con- trast to the opacity shadow maps, an approximation to the shadowfunction is stored in these textures. Thus it is possible to approximate shadows by using fewer hardware resources. Deep shadow mapping has already been applied to volume rendering [HKSB06]. In this paper we will propose an alternative implementation. Although work has been done regarding shadows in slice-based volume rendering approaches [BR98], to our knowledge the integration of shadows into GPU- Figure 1: The engine data set (256 × 256 × 128 voxel) based raycasting, which is considered the state-of-the- rendered using phong shading in combination with art volume rendering technique, has not been addressed shadow mapping. so far. However, due to the similar ray paradigm, it should be noted that shadows have been integrated in volume ray-tracing systems [WKB+02, WFMS05]. An Krüger and Westermann have proposed extensions overview of these techniques can be found in [MFS06]. to better exploit the capabilities of current graphics While the previously cited work as well as this pa- hardware [KW03]. GPU-based raycasting enables very per focus on volume rendering, it should also be men- efficient volume rendering on commodity graphics tioned that some researchers address the combination hardware by casting rays through the volume data set, of polygonal and volumetric data when considering which is represented as a 3D texture. To determine light interactions [ZXC05]. Also soft-shadowing tech- the entry and exit points for the rays the bounding box niques [CD03, ZC03, HLHS03] are not covered in this of the volume data set is rendered in a color coded paper, but it could be investigated how they can be ex- manner, such that the values in the RGB color channels tended to volume rendering. can be interpreted as volume texture coordinates. 3 IMPLEMENTATION OF SHADOW Various shadow algorithms have been developed in the past. Crow has proposed a shadow volume tech- TECHNIQUES nique for generating shadows for scenes containing In this section we address the implemented shadow- polygonal data [Cro77]. To compute shadows of an ing techniques, which we will compare in Section 4. object, its silhouette is extracted and extruded in di- We review the concept and implementation details of rection of the light rays in order to generate shadow shadow rays (see Subsection 3.1), describe our imple- polygons which form the shadow volume of an object. mentation of shadow maps to exploit them efficiently in During rendering each object is tested whether it lies GPU-based raycasting (see Subsection 3.2) and will de- inside or outside a shadow volume, and thus it can be scribe our improved deep shadow map implementation determined whether the object is shadowed. Due to (see Subsection 3.3). the polygonal nature of this algorithm, it is not suited for volume rendering. Another common approach for 3.1 Shadow Rays generating shadows when rendering polygonal data is Shadow rays are the most obvious way to integrate shadow mapping which has been presented in 1978 by shadows into a GPU-based raycaster. For each sam- Williams [Wil78]. Shadow mapping is an image-based ple along the viewing ray a shadow feeler is sent to the approach which exploits an additional rendering pass light source in order to determine whether the current in which the scene is rendered from the light source’s sample is shadowed. point of view in order to determine the structures closest We have implemented three different variations of to the light source. With this knowledge, a fragment- this shadowing technique. To support opaque occlud- based shadow test can be introduced in the main ren- ers only, each shadow feeler is cast until a sample is dering pass, i.e., each fragment is tested whether it is reached where the intensity exceeds the shadow thresh- further away from the light source than the correspond- old. If such a sample lies along the shadow feeler, the ing texel in the shadow map. While shadow mapping current sample is assumed to lie in shadow. However, allows very efficient shadows on a fragment basis, it due to the fact that only the first occurrence of a sample does not support semi-transparent occluders which can exceeding the shadow threshold is taken into account, be found in volume rendering. In order to address semi- shadowing becomes a binary effect, i.e., a sample is transparent structures opacity shadow maps serve as a either shadowed or unshadowed. To achieve different WSCG2008 Full papers 18 ISBN 978-86943-15-2 opaque geometry can be changed, and with it the con- tent of the generated shadow map. The example shadow map shown in Figure 2 has the same resolution as the viewport, i.e., 512 × 512 pixel, which allows to gener- ate shadows without introducing aliasing artifacts (see Figure 8). In comparison to shadow rays, shadow mapping is expected to run faster, since the light source visibil- ity does not need to be recalculated for each sample, but for each light ray only. This results in the fact that Figure 2: The first hit points in color-coded volume co- no semi-transparent occluders can be supported.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-