Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Cascaded Light Propagation Volumes For Real-Time Indirect Illumination

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Cascaded Light Propagation Volumes for Real-Time Indirect Illumination

Anton Kaplanyan∗ Carsten Dachsbacher†


Crytek GmbH VISUS / University Stuttgart

Figure 1: Real-time rendering (58fps on a NVIDIA GTX285 at 1280 × 720 resolution) of the “Crytek Sponza” scene (262k triangles, available
at http://www.crytek.com/downloads/technology/) using our method for indirect illumination with 3 cascades of light propagation volumes
(LPVs, with 50, 25 and 12.5 meters grid spacing; the scene extend is about 37 × 15 × 22m3 ). Lights, camera, and geometry can be fully
dynamic. The time required for the computation of the indirect illumination is about 10 milliseconds only. Right: We add participating media
(single-scattering) effects rendering at 34 fps by ray marching through the LPV. The overhead for ray marching is about 18ms.

Abstract imperfect visibility [Ritschel et al. 2008], or by using screen-space


techniques [Ritschel et al. 2009b].
This paper introduces a new scalable technique for approximating
indirect illumination in fully dynamic scenes for real-time applica- In this paper, we present a novel method for rendering plausible
tions, such as video games. We use lattices and spherical harmonics indirect lighting for fully dynamic scenes where no precomputation
to represent the spatial and angular distribution of light in the scene. is feasible. It has been designed having strict real-time requirements
Our technique does not require any precomputation and handles in mind and targets a computation time of only a few milliseconds
large scenes with nested lattices. It is primarily targeted at render- per frame on contemporary graphics hardware for PCs and consoles.
ing single-bounce indirect illumination with occlusion, but can be When adjusting the parameters of previous methods to meet these
extended to handle multiple bounces and participating media. We requirements, the approximate solutions usually exhibit disturbing
demonstrate that our method produces plausible results even when artifacts such as a splotchy appearance with methods based on instant
running on current game console hardware with a budget of only a radiosity [Keller 1997], or apparent patches in radiosity methods,
few milliseconds for performing all computation steps for indirect such as [Dachsbacher et al. 2007]. Even screen-space techniques,
lighting. We evaluate our technique and show it in combination with e.g. [Dachsbacher and Stamminger 2005; Ritschel et al. 2009b] that
a variety of popular real-time rendering techniques. compute subsets of light transport paths, exhibit noise or banding
when limiting the computation time, and typically introduce further
CR Categories: I.3.3 [Computer Graphics]: Picture/Image trade-offs such as short-distance indirect light only.
Generation—Display Algorithms; I.3.7 [Computer Graphics]:
Three-Dimensional Graphics and Realism—Shading Our method, which is a further development of the basic technique
presented in the SIGGRAPH’09 course program [Tatarchuk et al.
Keywords: global illumination, real-time rendering 2009], does not share these problems and produces plausible, visu-
ally pleasing results without flickering and high temporal coherence
1 Introduction even with very limited computation time. We achieve this by using
a lattice storing the light and the geometry in a scene. The direc-
tional distribution of light is represented using low-order spherical
Many recent papers introducing methods for computing global illu-
harmonics. We sample the surfaces using reflective shadow maps
mination state that this is a hard problem for interactive applications
and use this information to initialize the lattice from scratch every
– surely a valid statement due to the inherent complexity of light
frame. Based on this representation, we developed a data-parallel
transport. Despite significant advances in recent years, rendering
light propagation scheme that allows us to quickly, and plausibly,
indirect illumination in real-time, without trade-offs or precompu-
approximate low-frequency direct and indirect lighting including
tation, is still an elusive goal. Since indirect illumination is known
fuzzy occlusion for indirect light. Our propagation scheme is de-
to be perceptually important, many attempts have been made to
rived from the Discrete Ordinates Method [Chandrasekhar 1950]
coarsely approximate it, with as little computation time as possible.
and we show that a simplified, more local, scheme is sufficient for
There is consensus that an accurate computation thereof is often not
plausible indirect lighting. Direct lighting from point lights, or small
necessary [Yu et al. 2009]. Recent work exploits this fact, for ex-
area lights, is computed using standard techniques such as shadow
ample, by using interpolated visibility [Křivanek and Colbert 2008],
mapping. Our method has been integrated into the CryENGINE R

∗ e-mail:
antonk@crytek.de 3, and handles large, fully dynamic scenes through nested lattices
† e-mail:
dachsbacher@visus.uni-stuttgart.de of different resolutions. We focus on plausible approximations for
ACM,
c 2010. This is the author’s version of the work. It is real-time applications rather than on physically-correct rendering of
posted here by permission of ACM for your personal use. Not for indirect illumination. Our method is best suited for low-frequency
redistribution. The definitive version was published in the Proceed- indirect lighting from diffuse surfaces; we discuss the limitations
ings of the 2010 Symposium on Interactive 3D Graphics and Games. arising from spatial discretization, low-order spherical harmonics,
http://doi.acm.org/10.1145/1507149.1507176 and the propagation scheme.
2 Previous Work faces, and more accurately where geometric detail is present. This
A tremendous amount of research has been conducted in the field of idea has been further improved with smart clustering of the RSM’s
global illumination (GI). We focus on previous work that has been pixels [Nichols et al. 2009]. Note that all aforementioned methods
presented in the context of interactive rendering. For a more compre- compute one-bounce indirect illumination without occlusion only.
hensive overview of non-interactive methods we refer to [Dutré et al. Ritschel et al. [2008] present an efficient method to quickly generate
2006]. We roughly classify the methods for interactive applications hundreds of imperfect shadow maps. These allow the approximation
into five categories. of the indirect illumination from VPLs with sufficient quality. How-
ever, in order to avoid flickering and to provide temporal coherence a
large number of VPLs is required (typically hundreds to thousands),
Classic methods Huge progress has been made in the field of
and obviously this takes a toll on performance and prevents high
ray tracing. Although recent work achieves interactive performance
frame rates in dynamic scenes.
with complex lighting effects [Wang et al. 2009], these methods are
still not applicable to real-time applications with complex scenes.
Lattice-based methods The Discrete Ordinates Method
Recently, variants of radiosity methods tailored for graphics hard-
ware have also been introduced. Dong et al. [2007] achieves in- (DOM) [Chandrasekhar 1950] discretizes the quantities in the
teractive global illumination for small scenes, where visibility was radiative transfer equation (RTE) in space and orientation (DOMs
evaluated directly on the hierarchical link mesh. Explicit visibility are typically used for computing radiative transfer in participating
computations can be replaced by an iterative process using anti- media). These discrete values are used to approximate the different
radiance [Dachsbacher et al. 2007]. Although interactive GI in terms in the RTE: the radiance distribution is stored in a 3D grid,
moderately complex scenes becomes possible, the use of dynamic and light is exchanged between neighboring volume elements,
objects is restricted. Bunnell [2005] coarsely approximates indirect reducing the computation to local interactions only. A variant
illumination and ambient occlusion using a finite element technique of these methods postulates a simple photon transport model
allowing for deforming objects. that describes a diffusion process to compute light transport in
participating media based on the lattice-Boltzmann method [Geist
et al. 2004]. Recently, Fattal [2009] presented an improvement of
Precomputed and low-frequency radiance transfer Many
DOMs to reduce light smearing (due to repeated interpolation) and
techniques for real-time GI precompute the light transport includ-
ray effects (due to discretized directions). Note that although these
ing all visibility information which entails restrictions such as
methods are efficient, and (potentially) highly parallel, they do not
static [Sloan et al. 2002] or semi-static scenes [Iwasaki et al. 2007].
run at interactive frame rates.
Hašan et al. [2007] approximate GI by many point lights and present
a scalable GPU-technique for high-quality images targeting render-
ing times of few seconds. The radiance transfer is often represented 3 Light Propagation Volumes
in spherical harmonics (SH) basis. Recently, the limitations of these
methods have been eased, e.g. Sloan et al. [2007] demonstrate real- Our work is inspired by the discrete ordinate methods and the Lattice-
time indirect illumination for low-frequency incident lighting and Boltzmann lighting technique (as such there is a conceptual similar-
visibility when these are represented with a small number of SH. ity to volume grid radiosity and grid-based fluid advection methods).
Similar to these approaches, we represent the lighting in a scene
Screen-space methods In recent years, GPU-friendly tech- sampled on a lattice. This allows us to model the light transport
niques operating in image space became popular, and are presently using simple, local operations that in turn can be easily parallelized.
widely used. As any standard shadow map, the reflective shadow We base our computation on intensity stored in each cell of this lat-
map (RSM) [Dachsbacher and Stamminger 2005] captures directly tice. Our contributions include a fast initialization of the lattices for
lit surfaces, but stores additional information that is required to com- light propagation that can be computed from scratch for every frame,
pute the indirect illumination from these surfaces such that each a novel propagation scheme that propagates along the main axial
pixel can be seen as a small light source. Rendering indirect illu- directions (opposed to 26 directions in other schemes) while still
mination from the RSM can be implemented via sampling a subset providing good results for low-frequency lighting, and a hierarchical
of the pixel lights. Screen space ambient occlusion [Mittring 2007; approach for handling large scenes.
Bavoil et al. 2008] is part of almost any real-time rendering engine
It is well known that grid based methods suffer from two major
nowadays. Recently, Ritschel et al. [2009b] extended these methods
errors. The so-called ray effect stems from the discretization of the
by accounting for directional lighting and show colored shadows and
directions in which light can travel and causes distracting beams
indirect illumination. Note that these techniques compute light trans-
of light. Repeated averaging during the propagation itself further
port over small distances (in image space) only, and typically require
causes light smearing in space. It is evident that such methods –
post-processing to reduce sampling artifacts. Image Space Photon
which are typically applied in the domain of participating media –
Mapping recasts the initial and final photon bounces of traditional
are not well suited for high-frequency (direct) lighting. For these
photon mapping as image-space operations on the GPU [McGuire
reasons we follow the idea of Ramankutty and Crosbie’s modified
and Luebke 2009], and achieves interactive to real-time frame rates
DOM [1997], and use the grid-based lighting for low-frequency light
for complex scenes. Ritschel et al. [2009a] accellerate final gathering
only, where these errors are tolerable, especially in the real-time
with a parallel micro-rendering technique running on the GPU. They
rendering context of our target applications.
support BRDF importance sampling and report interactive frame
rates for complex scenes. In the following we describe the basic steps of our method. For
this we assume that our scene is embedded into a 3D grid of a fixed
Instant radiosity methods The entire lighting in a scene can be resolution (we remove this limitation by introducing cascaded grids
approximated by a set of virtual point lights (VPLs) [Keller 1997], in Sect. 4). We have two grids, one storing the intensity that is ini-
and techniques based on this instant radiosity idea have gained much tialized from the surfaces causing indirect lighting or low-frequency
attention in recent years. RSMs can be used to create VPLs for one direct lighting; and a second grid that stores a volumetric approxi-
bounce of indirect light, and their contribution can be accumulated mation of the scene geometry and is used for fuzzy blocking as the
in screen space using splatting [Dachsbacher and Stamminger 2006], light travels through the scene. Both grids store a spherical func-
or multi-resolution splatting [Nichols and Wyman 2009]. The latter tion represented as low-frequency SH approximation. We discuss
computes the indirect lighting at a lower resolution for smooth sur- difficulties arising from coarse light propagation volumes in Sect. 7.
Computing the indirect lighting with our technique consists of four Hanrahan 2001], and rotated to the direction np [Sloan 2008]. We
subsequent steps: scale these coefficients by the flux to obtain the SH coefficients for
a VPL.
• Initialization of the light propagation volume (LPV) with the
surfaces causing indirect lighting and low-frequency direct Note that the flux of a VPL already accounts for the area of the
light (area light sources). pixel from which a VPL has been created. Thus there is no further
scaling required, and we can accumulate the intensities, i.e. the
• Sampling of the scene’s surfaces using depth peeling from the
coefficients of the SH approximation, in the grid cells. In fact, we
camera, and multiple reflective shadow maps. This information
use 3 coefficient vectors to represent RGB data; however, for the
is used to create a coarse volumetric representation of blocker
explanation of our method we shown only one component.
geometry.
• Light propagation starting from the initial LPV and accumu- Every VPL is treated in this way and then “injected” into the LPV.
lating the intermediate results (yielding the final light distribu- After determining the grid cell we simply accumulate the SH coeffi-
tion). cients. Note that this process introduces spatial discretization of the
lighting and inherently assumes that the surfaces causing indirect
• Lighting the scene geometry using the propagated light. In ad- lighting do not occlude each other inside a single cell.
dition to directly applying the LPV for diffuse lighting, we also
present plausible approximations to glossy indirect lighting
Low-frequency direct light The second kind of VPL accounts for
and participating media.
low-frequency direct lighting from area lights, environment maps
and larger groups of point lights, such as those stemming from
3.1 LPV Initialization particle systems. Again, we create a dense sampling, i.e. several
hundreds to thousands of VPLs for these light sources, and inject
We use the light propagation volume (LPV) to compute the low- them into the LPV in exactly the same way as those created from
frequency lighting in a scene only, i.e. mainly the indirect light. The RSMs. VPLs from environment maps are injected into the outer
first step is to transform the surfaces causing that lighting into the di- layer of the LPV cells; other VPLs outside the grid are omitted.
rectional intensity representation and initialize the LPV accordingly.
Strong direct lighting and shadowing from point or directional light The result of the LPV initialization pass is a grid of initial intensity
sources is computed using traditional techniques such as shadow distributions that is used to compute the light propagation in the
mapping. scene. In order to reduce the number of injected VPLs, we also
examined clustering similar to the light cuts method [Walter et al.
The initialization is based on the idea that one can convert the low- 2005]. However, the injection pass proved to be very cheap and
frequency lighting into a set of virtual point lights (VPLs), in the clustering mostly did not amortize in our experiments.
spirit of [Keller 1997]. However, we use a significantly larger num-
ber of VPLs than typical instant radiosity methods, since we do
not compute their contribution individually, but only use them to 3.2 Scene Geometry Injection
initialize the LPV.
In addition to the initial intensity distribution we create a volumetric
representation of the scene’s surfaces. This coarse approximation of
Indirect light We first create VPLs accounting for indirect lighting the geometry is used for blocking the light during propagation and
by rendering a reflective shadow map (RSM) [Dachsbacher and thus for computing indirect shadows.
Stamminger 2005] for every light source. A RSM is an extended
shadow map that can be quickly created in a single render pass on the We aim at fully dynamic scenes without precomputation and conse-
GPU. It captures the directly lit surfaces that cause the first-bounce quently this information has to be created on the fly as well. To this
indirect lighting. Each texel of a RSM can be interpreted as a small end, we re-use the sampling of the scene’s surfaces that is stored in
area light source with a spectral and directional intensity distribution, the depth and normal buffers of the camera view (using a deferred
Ip (ω), determined by the orientation np of the texel and its reflected renderer) and in the RSMs. Note that we typically created RSMs for
flux Φp : numerous light sources and thus have a dense sampling of a large
Ip (ω) = Φp hnp |ωi+ , portion of the scene’s surfaces. If required, we can gather more
information by adding depth-peeling passes for the RSMs or the
where h.|.i+ denotes the dot product with negative values clamped camera view. It is also possible to use a precomputed point sampling
to zero; we omit spectral dependence here for simplicity. The next of the surfaces, similar to [Ritschel et al. 2008], but this implies
step is to transform all VPLs into the SH representation and store additional storage and transformation costs.
their contributions in the LPV cells. We can easily determine the
cell in which the VPL resides. However, if the VPL points away
from that cell’s center, we do not want to add its contribution to this Fuzzy occlusion Each sample represents a small surface element
cell, but rather to the next cell in order to avoid self lighting and (surfel) with a given location, orientation, and size. We model the
shadowing. For this, we virtually move each VPL by half the cell occlusion in spirit of [Sillion 1995], and assume that we can use
spacing in the direction of its normal, before determining the cell. In the accumulated blocking potential of surfels in a grid cell as a
that cell, we only take the orientation of the VPL into consideration, probability for blocking light from a certain direction going through
i.e. we ignore its exact positioning inside that cell. that cell. By this, we can render soft shadows, but surfaes smaller
than the grid size, e.g. foliage, do not produce resolved shadows.
We use SH to represent the directional distribution of intensity. Using
n bands of SH yields n2 coefficients, cl,m , for the basis functions, The amount of blocking by one of these surfels depends on its
yl,m (ω), both indexed by the band l and degree m with −l ≤ m ≤ l. size, and on the cosine of the angle between its normal and the
We can easily derive analytical expressions for the SH coefficients light direction in question. The blocking probability of a single
of a clamped cosine-lobe centered around a given direction vector, surfel with area As , and normal ns in a cell of grid size s is thus
the VPL normal np is this case. A clamped cosine oriented along B(ω) = As s−2 hns |ωi+ . Note that we assume that scene objects
the z-axis can be expressed in zonal harmonics [Ramamoorthi and are closed surfaces and thus use a clamped cosine lobe for the
Face f
ωc nl
Il(ω)
V(ω)
interpolated
blocking
I(ω) potential
source cell propagation along source cell destination cell reprojection of the flux cell centers
axial directions into a point light of geometry volume

Figure 2: Left: Each cell of the LPV stores the directional intensity used to compute the light that is propagated from a source cell to its 6 (4 in
2D) neighbors. Center: We compute the flux onto the faces of the destination cell to preserve directional information. Right: We account for
fuzzy occlusion by storing a volumetric representation of the scene in a second grid.

blocking probability. This is also because a low-order SH projection the dot product of the SH-vectors cl,m and vl,m . These “transfer
of an absolute cosine degrades to a near isotropic function. vectors” vl,m can be precomputed once and stored for the propaga-
tion scheme. The problem, however, is that the integral value can
be very inaccurate for low-order SH approximations, and thus we
Injection Similar to the VPL injection we accumulate the SH propose using a different strategy for this case.
projections of the blocking potential into the geometry volume (GV). R Instead of a transfer
vector we compute the solid angle ∆ωf = Ω V (ω)dω of each face
This accumulation process is correct if there is only one surface in the destination cell, and determine the central direction ωc of
intersecting a grid cell as the mutual occlusion of surface samples the visibility cone. The flux reaching the face is then computed as
within a cell cannot be resolved (this is ameliorated by the use of ∆ωf /(4π) · I(ωc ). Effectively this means that we take the intensity
screen-space ambient occlusion; see Sect. 7). The GV has the same in direction ωc as average intensity over the solid angle.
resolution as the LPV, but is shifted by half a cell, such that its cell
centers are located at the corners of the LPV cells to achieve better
interpolation of the blocking potential during light propagation. Reprojection Using this propagation we obtain the incident flux
for each face of a destination cell and then transform it into outgoing
A surface might be sampled in the camera view and one or more intensity for the subsequent propagation again. For this we compute
RSMs, and we need to ensure that its blocking is not accumulated the intensity of a new point light source (with the same emission
multiple times. For this, each buffer is accumulated into a separate characteristics as our VPLs) at the destination cell’s center pointing
GV and after injection the GVs are merged into one using a maxi- towards the face and causing exactly as much flux as the face received
mum operation on the SH-vectors. As an optimization we can also due to the propagation. That is, the flux on the Rface, Φf , is equal
reuse the surface samples from previous frames (for static geome- to the total emitted flux of the point light: Φf = Ω Φl hnl , ωi+ dω,
try), which reduces the cases where surfaces are not captured by the and thus Φl = Φf /π. Similar to the light injection stage, we scale
current view or RSMs. the clamped cosine lobe by Φl and accumulate the SH coefficients,
for the new point light located at the cell’s center, in the destination
3.3 Propagation Scheme cell for the next iteration.

The inherent idea of grid-based methods, such as DOM, is that light The propagation is computed for each source cell and each of its
propagation through the scene is computed using successive local adjacent cell’s faces (shown yellow in Fig. 2). Note that this process
iteration steps. In this regard, our method is no exception, but the conserves energy that is expected from light propagation in vacuum.
propagation scheme itself differs and is detailed in this section. However, the propagation together with the reprojection introduces
spatial and directional discretization. Note that this is common to all
lattice-based methods, and we compare our propagation scheme in
Intensity propagation The input for the first iteration step is the flatland to a reference solution and DOMs in Sect. 5.
initial LPV from the injection stage; subsequent iterations take
the LPV from the previous iteration as input. Each cell stores the
Blocking We also need to integrate the blocking of light due to
intensity as a SH-vector and the light is then propagated to its 6
scene geometry into the propagation step. In the geometry injection
neighbors along the axial directions (Fig. 2, left, shows the 2D case
stage we computed the GV from the surfaces in the scene that stores
with 4 axial directions). In the following, we describe the propaga-
anisotropic occlusion probabilities for exactly this purpose. The GV
tion from one source to one destination cell only; the propagations
is displaced by half the grid size with respect to the LPV. By this, a
along the other directions are computed analogously. Let us de-
cell center of the GV resides on a corner of an LPV cell. Whenever
note the PSH-approximation of the intensity of the source cell as
we propagate from a source to a destination cell, we bi-linearly
I(ω) ≈ c y (ω). Next we compute the flux onto each
l,m l,m l,m interpolate the GV’s SH-coefficients at the center of the face through
of the faces of the adjacent destination cell. For this we define the which we propagate, and evaluate the occlusion for the propagation
visibility function, V (ω), of a face f with respect to the source direction to attenuate the intensity. Note that we do not consider this
cell’s center. V (ω) = 1 if a ray starting at the source cell center in occlusion in the very first propagation step after injection in order to
direction ω intersects the face, otherwise V (ω) = 0. Fig. 2 (center) prevent self-shadowing.
shows V (ω) for the top face of the destination cell. The total flux
reaching the face canRbe computed by integrating over directions
using V (ω) as Φf = Ω I(ω)V (ω)dω. Iterations The result after computing all propagations in the LPV
is accumulated in a separate 3D grid after each iteration: the sum
The faces’ visibility functions can beP projected into SH yielding a of all intermediate results is the final light distribution in the scene.
coefficient vector vl,m with V (ω) ≈ l,m vl,m yl,m (ω). The inte- The number of required iterations depend on the resolution of the
gral over intensity times visibility can then be easily computed using grid. Similar to [Geist et al. 2004] we use two times the longest
n

Figure 3: Such intensity distributions can result from blockers be-


tween cells (indicated by dashed lines). We detect the discontinuity
in the intensity by computing its gradient in normal direction n.
Figure 4: We use a set of nested, or cascaded, LPV and GV grids to
represent large scenes with fine resolution close to the camera, and
coarse resolution further away.
side of the LPV iterations as a heuristic for the scheme as described
above. Obviously this is not feasible for our real-time requirements
for reasonably sized LPVs. The multi-resolution scheme introduced
in Sect. 4 yields similar results with less iterations. from this object by not rendering it to the RSM. This is to prevent
aliasing artifacts (see next section).
Obviously there is inherently strong blurring caused by the propaga-
Light propagation is computed for all grids independently. Note
tion scheme. However, since we use this method for indirect light
that VPLs in a fine grid have also been injected into the coarser
only, the results – especially for low-band SH approximations that
grids (green cells in Fig. 4). This ensures that indirect light from
we use for real-time rendering – are of sufficient quality and can be
nearby objects bleeds into distant parts of the scene. When using
computed very efficiently (discussed in Sect. 5 and 7).
the LPVs for lighting, we look up the finest grid at the respective
location. At the boundary of a fine grid we create a smooth transition
3.4 Using the Light Propagation Volume for Rendering to the next-coarser grid by interpolation between both levels (similar
to [Losasso and Hoppe 2004]). Note that the indirect light due
The accumulated results of all iterations represent the light distri- to VPLs that have been injected into a coarser grid (but not into
bution in the scene. In the simplest form we query the intensity by finer grids) is cut-off due to that blending. We did not, however,
a tri-linearly interpolated lookup of the SH coefficients. We then experience distracting or even visible artifacts from this cut-off.
evaluate the intensity function for the negative orientation of the
surface, similar to irradiance volumes [Greger et al. 1998; Oat 2006]. 4.2 Coherent Solutions in Dynamic Scenes
However, since we store intensity we need to convert it into incident
radiance and due to spatial discretization we assume that the distance Providing a stable solution under object, camera, and light movement
between the cell’s center (where the intensity is assumed to be), and is very important for interactive applications. The primary cause
the surface to be lit is half the grid size s. for potentially inconsistent light propagation stems from the spatial
discretization in the LPV. To prevent this, we snap the cascaded
One problem of coarse volumes paired with low-frequency approxi-
LPVs – that move with the camera – to multiples of the grid size.
mations of the lighting is self-illumination and light-bleeding. We
By this “one-cell grid snapping” we maintain a consistent VPL and
found that a dampening factor based on the directional derivative
geometry injection under camera movement.
of the intensity distribution greatly reduces these artifacts. For a
surface location x and normal n, we determine the tri-linearly inter- The second source of inconsistency – in other algorithms often
polated SH coefficients cl,m and the directional derivative in normal causing flickering – is the sampling of light emitting and reflecting
direction ∇n cl,m (computed via differencing). Whenever the the surfaces. As we can afford to excessively sample these surfaces and
derivative is large, and cl,m and ∇n cl,m are deviating, we dampen inject a huge number of VPLs (several hundred thousand), there
cl,m before computing the lighting (Fig. 3 shows two such typical is a high redundancy of light emitters in the LPV. In contrast to
situations). other methods, such as instant radiosity based methods, this redun-
dancy allows the rendering of indirect illumination from moving and
complex, detailed objects, even such as foliage, without flickering.
4 Cascaded Light Propagation Volumes
However, we noticed that small moving objects – if their size is
Using a single LPV to compute the light propagation in an entire below the grid cell size – can cause artifacts in the form of unsteady
scene (with acceptable resolution) would require a very large grid. moving indirect lighting. In this case the spatial discretization of the
Instead we use a set of nested grids moving with the viewer (Fig. 4), LPVs becomes noticeable. As an ad-hoc solution, we fade out the
similar to geometry clipmaps [Losasso and Hoppe 2004] but in 3D. VPLs from such objects. This solution seems tolerable as the lower
The grids are not exactly centered around the viewer, but displaced grid resolutions are further away from the camera.
into the view direction. This provides high spatial resolution in parts
of the scene close to the camera, and also covers distant parts with
lower resolution. The nested grid approach allows us to use grids
5 Qualitative Evaluation of the Propagation
of smaller size (typically 323 cells) and thus reduce the number of
required propagation iterations. We show flatland (2D) scenes to discuss the deviations and approx-
imation errors due to our propagation scheme. Fig. 5 plots light
propagation in two simple settings with 1 and 2 area light sources
4.1 Nested Grid Propagation computed analytically (gray), using the standard DOM propagation
to all 8 neighbor cells (DOM8, green), and our method (LPV, red).
Our method as described in Sect. 3 remains largely unchanged. VPLs For comparison, we also include a modified DOM scheme (DOM4,
and geometry are injected into all nested grids at the same time. blue) that propagates to the main axial directions only, similar to
However, if the size of an object (determined using its bounding ours, to demonstrate the effectiveness of computing the flux per face
box) is smaller than the cell size of a grid, we do not create VPLs compared to a center-to-center transfer.
DOM8, 2SH DOM4, 2SH LPV, 2SH DOM8, 8SH DOM4, 8SH LPV, 8SH

Figure 5: Two simple settings in flatland (top row: 1 area light source, bottom row: 2 area lights in L-shape): for comparison we plot the
intensity for each grid cell computed using DOMs with 8 and 4 propagation directions (green, blue), our propagation scheme (red), and
analytically (grey).

We observe that for few SH bands, all three yield comparable results pong render targets) is 323 × (2 × 4) × 3 × (#cascades + 2) =
with expectedly blurred intensity distributions. Our LPV scheme 3.75MB for the LPV and 323 ×(2×4)×#cascades = 0.75MB for
preserves the main intensity directions better than DOM4, e.g. light the GV (for the consoles the memory is halved due to the QUVW8
leaving at grazing angles (highlighted cells in top row), but obviously format). Note that storing spectral reflectivity would triple the GV
is blurry as well. For more SH bands, DOM4 produces very strong memory and bandwidth; in our examples with multiple bounces we
ray effects, whereas LPV produces no such artifacts (highlighted in used monochromatic reflection for further bounces only. Table 1
bottom row). However, DOM8 preserves distribution much better. shows detailed timings.
This leads us to the conclusion that our scheme is well-suited for few
SH bands (2 to 4) and large light sources (larger than 1 cell). In these
cases it yields good approximations, preserves the main direction of
light transport well, and only requires 4 (6 in 3D) neighbor cells for
propagation compared to 8 (26 in 3D) for DOM8.

6 Implementation Details
Our method has been integrated into the CryENGINE R
3: a multi-
platform (DirectX 9 and 10 on PC, Sony PS3 R
and Microsoft Xbox
360 R
) real-time rendering engine. Due to the performance require-
ments the implementation uses only 2 SH-bands (4 coefficients) per
color channel for the LPV. The cascade consists of 3 grids, each
stored as three RGBA 16-bit floating point textures of size 323
LPV, 3 cascades each 323 photon mapping (PBRT)
(QUVW8 format, i.e. 8-bit signed integer per component, on con-
soles). The geometry volume is of the same format and resolution
as the LPV (but with only one texture and no spectral data), and the
surfels are created from the depth and normal buffers of the camera
view and RSMs. High-resolution buffers, e.g. the camera view, are
down-sampled prior to the surfel injection.
The RSMs store a depth buffer (32-bit float), and normals and flux
(RGBA 8-bit each) of size 2562 (1282 for consoles). This amounts
to 216 , or 214 , VPLs per primary light source. The VPLs are injected
into the LPV cascade using point rendering. This requires either diff. LPV–photon mapping Imperfect Shadow Maps
vertex texture fetches (used for DirectX 9/10, and Xbox 360), or
rendering to vertex buffer (faster on the PS3). Figure 6: Top left: rendering the Crytek Sponza (untextured for
comparison) with LPVs, 3 cascades each 323 , at 60fps. Top right:
For the light propagation we perform a GPU-friendly gathering ground-truth solution rendered with photon mapping and PBRT
procedure with ping-pong rendering: for every cell (in every cascade) (single-bounce indirect light only, 200000 photons, 1024 final gather
we look up the intensity distributions of the 6 neighbor cells. We then samples, approx. 45 minutes). Bottom left: difference image of the
compute the flux onto the faces, reproject the flux and accumulate LPV rendering and the ground-truth solution; green regions are too
the output in a render target. In most scenes 8 iterations provided bright with LPVs, red regions too dark. Bottom right: rendering
visually pleasing results. Note that this limits the distance of light with Imperfect Shadow Maps [Ritschel et al. 2008] at 15.6fps with
propagation and might produce artifacts in large, sparse scenes (see 256 VPLs.
Fig. 12). The GPU memory required for our method (including ping-
7 Results and Discussion

Obviously our method computes a low-frequency approximation


to the indirect lighting in a scene only. All high-frequency vari-
ations, i.e. surface details, are achieved using bump mapping and
screen-space ambient occlusion. The results indicate that our method
produces plausible renderings (the indirect light is exaggerated for
illustration purposes) in many scenarios. Fig. 6 shows a comparison
to ground-truth for the diffuse Crytek Sponza scene. Note that the
images overall compare well, however, occlusion from nearby geom-
etry in the LPV rendering is approximated by ambient occlusion and
shows differences to the photon mapping image. All LPV renderings
have been captured at 1280x720 resolution on a NVIDIA GTX285.
In this section we describe further rendering techniques using the
LPV, followed by a discussion of benefits and limitations. Figure 7: Indirect lighting without and with fuzzy occlusion (top
left 130fps, and right 90fps), and multiple bounces (bottom, 85fps)
rendered using one LPVs at 323 . 2562 VPLs from the RSM have
Multiple indirect bounces We can easily modify the propagation been injected into the LPV; 2 × 2562 surfels have been created from
step to account for (coarsely approximated) multiple diffuse bounces the RSM and the camera view (downsampled) for the GV.
of indirect light (Fig. 7). When propagating from a source to a
destination cell, we perform an additional lookup into the GV with
an offset of one cell into propagation direction (Fig. 8, left). This
yields a blocker approximation B(ω) that we use to immediately Participating media We can also use the LPVs to render plausible
reflect the light that is propagated to the destination cell. We can effects of single-scattering participating media (see teaser). For this
estimate the diffuse illumination of the blocker geometry as B(−ωc ) we perform a final render pass and ray march through the cascade
(effectively computing the dot product of the incident light direction of LPVs and accumulate the inscattered light assuming an isotropic
−ωc and the surface normal), scaled by the propagated intensity and phase function. Strictly speaking, adding inscattered light generates
the reflectivity of the blocker geometry. The reflected light has the energy, and we need to attenuate light during propagation. The step
same directional distribution as the diffuse blocker geometry, and size is proportional to the grids’ cell size, i.e. we use larger steps
thus we scale B(ω) by the reflected intensity and inject it into the in coarse volumes, and smaller steps close to the camera. In the
destination cell. Note that we only need to modify the propagation teaser we show an example rendering with homogeneous media; the
step causing an additional cost of approximately 0.3ms on a NVIDIA rendering cost increased by 18ms for the ray marching with a ray
GeForce GTX 285 for a 323 LPV and 8 iterations; all other steps marching step size equal to the LPV grid cell size. Note that we can
remain unchanged. also plausibly render non-homogeneous media when using a volume
texture to store scattering coefficients.

Glossy reflections Obviously our propagation scheme causes


strong blurring of the propagated light. However, we can use the Discussion The main advantages of our method are the low cost
LPVs to gather incident light for rendering glossy surfaces (Fig. 8 and that it produces stable and flicker-free renderings. The latter
right, and 9). The idea is to compute the incident light from the is achieved with the high sampling of the surfaces using RSMs
reflection direction r by marching through the LPV and averaging and the VPL injection. An insufficient RSM resolution can cause
the intensity I(−r) of all cells, divided by the squared distance to the flickering (see accompanying video), fortunately, creating RSMs and
cell that we pass through; in practice 4 cells proved to be sufficient. injection make up a small fraction of the rendering cost only. Thus
This procedure can be interpreted as going back in propagation time our method can be used to handle fully dynamic scenes including
(because we sample light that has not been propagated thus far), those with “intricate” geometry, such as foliage and fences (Fig. 10).
and look up the intensity distributions before they get smeared out The limitations of our method are obvious as well: first, the spatial
further. The lookup into multiple cells smooths the estimate and discretization might be visible as light bleeding (Fig. 11, left); this
prevents artifacts, such as discontinuities, in the glossy reflections. is somewhat reduced by the cascaded approach. Second, due to
the SH representation of the intensity and the propagation, the light
strongly diffuses and is not propagated strictly straight ahead, and
there is no reasonable chance of handling glossy surfaces during
Stage GTX285 Xbox 360 PS3 propagation. The impact of the number of propagation iterations is
RSM rendering 0.16 0.5 0.8 shown in Fig. 12; the cascaded approach reduces the computation
VPL Injection 0.05 0.2 0.4
GV Injection 0.02 0.15 0.15
Propagation 0.8 / 1.1 / 1.4 0.8 / 1.1 / 1.5 0.7 / 1.1 / 1.5 cell centers of
LPV Lookup 2.4 2.0 1.5 geometry volume

Total 3.4 / 3.7 / 4.0 3.5 / 3.8 / 4.2 3.4 / 3.8 / 4.2 interpolated camera
blocking r
potential ωc
n
Table 1: Detailed timings for the Crytek Sponza scene (see teaser) B(ω)
in milliseconds for the individual stages (for one 323 LPV grid and reflecting
blocker
8 iterations). The three timings for the propagation step refer to: approximation
no occlusion, fuzzy occlusion, fuzzy occlusion and multiple bounces. source cell destination cell
Note that only the cost of the RSM rendering depends on the scene
complexity. All measurements at 1280x720 resolution (no MSAA), Figure 8: Left: we use the GV to approximate more bounces of
and RSM size of 2562 (=number of injected VPLs) for NVIDIA indirect illumination. Right: we can light glossy surfaces using ray
GTX285 and 1282 for consoles. marching in the LPV.
Figure 11: Left: light bleeding from the right wall through the shelf
due to low spatial discretization in the LPV and GV. Right: the
shadow of the backmost box is missing – it is not captured in the
RSM, and only a fraction is visible in the camera image; thus too
few surfels are injected into the GV when not using depth peeling.

Figure 9: We ray march the LPVs along the reflection direction of


specular surfaces to render plausible glossy materials (rendered
at 1280 × 720 with 110fps on GTX285 using one LPV at 323 , no
secondary occlusion; the scene consists of 265k triangles).

cost in large scenes which would require high resolution grids (the
cost is linear in the number of iterations and grid cells). Lastly,
we have to exercise caution to make sure that geometry causing
indirect light or blocking is sampled by RSMs or the camera view to
inject the respective data into the grids (Fig. 11, right). Please see Figure 12: Top row: the approximation of indirect light using a
the accompanying video for further demonstration of benefits and single LPV (30, 60, 80, and 100 meters grid spacing). Note that the
limitations. cascaded approach is required to capture medium and long distance
light transport with few iterations; short distance light transport
is approximated with screen-space techniques. Bottom row: using
8 Conclusion and Future Work a single LPV (no GV) with 1, 4, 8, and 16 propagation iterations;
too few iterations limit the distance that the light travels. Typically,
We presented an efficient method for the rendering of plausible in- 8 iterations produce visually pleasing results, in particular with
direct lighting in fully dynamic, complex scenes in real-time that cascaded LPVs.
uses volumetric representations of the light and geometry in a scene.
We demonstrated our method in various scenes in combination with
wide-spread real-time rendering techniques. In the future we would B UNNELL , M. 2005. GPU Gems 2: Programming Techniques for
like to reduce the limitations of our method, e.g. by following High-Performance Graphics and General-Purpose Computation.
Fattal’s [2009] ideas, and by investigating non-rectangular grid struc- Addison-Wesley Professional, ch. Dynamic Ambient Occlusion
tures which might also be a promising research direction. and Indirect Lighting, 636–648.
C HANDRASEKHAR , S. 1950. Radiative Transfer. Dover Pubn Inc.
References
DACHSBACHER , C., AND S TAMMINGER , M. 2005. Reflective
BAVOIL , L., S AINZ , M., AND D IMITROV, R., 2008. Image-space shadow maps. In Proc. of the Symposium on Interactive 3D
horizon-based ambient occlusion. ACM SIGGRAPH 2008 talks. Graphics and Games, 203–213.
DACHSBACHER , C., AND S TAMMINGER , M. 2006. Splatting
Indirect Illumination. In Proc. of the Symposium on Interactive
3D Graphics and Games, 93–100.
DACHSBACHER , C., S TAMMINGER , M., D RETTAKIS , G., AND
D URAND , F. 2007. Implicit visibility and antiradiance for inter-
active global illumination. ACM Transactions on Graphics (Proc.
of SIGGRAPH 2007) 26, 3.
D ONG , Z., K AUTZ , J., T HEOBALT, C., AND S EIDEL , H.-P. 2007.
Interactive Global Illumination Using Implicit Visibility. In Pa-
cific Graphics, 77–86.
D UTR É , P., BALA , K., AND B EKAERT, P. 2006. Advanced Global
Illumination. AK Peters.
FATTAL , R. 2009. Participating media illumination using light
propagation maps. ACM Transaction on Graphics 28, 1, 1–11.
Figure 10: LPVs render flicker-free indirect illumination (shown G EIST, R., R ASCHE , K., W ESTALL , J., AND S CHALKOFF , R. J.
exaggerated) from complex geometry such as foliage; rendering at 2004. Lattice-boltzmann lighting. In Rendering Techniques 2004
50fps on a GTX285 (no fuzzy occlusion, one-bounce indirect). (Proc. of the Eurographics Symposium on Rendering, 355–362.
G REGER , G., S HIRLEY, P., H UBBARD , P. M., AND G REENBERG , S LOAN , P.-P., K AUTZ , J., AND S NYDER , J. 2002. Precomputed ra-
D. P. 1998. The irradiance volume. IEEE Computer Graphics diance transfer for real-time rendering in dynamic, low-frequency
Applications 18, 2, 32–43. lighting environments. ACM Transactions on Graphics (Proc. of
SIGGRAPH 2002) 21, 3, 527–536.
H A ŠAN , M., P ELLACINI , F., AND BALA , K. 2007. Matrix row-
column sampling for the many-light problem. ACM Trans. Graph. S LOAN , P.-P., G OVINDARAJU , N., N OWROUZEZAHRAI , D., AND
26, 3, 26. S NYDER , J. 2007. Image-based proxy accumulation for real-time
soft global illumination. In Pacific Graphics, 97–105.
I WASAKI , K., D OBASHI , Y., YOSHIMOTO , F., AND N ISHITA , T.
2007. Precomputed radiance transfer for dynamic scenes taking S LOAN , P.-P., 2008. Stupid spherical harmonics tricks. Presentation,
into account light interreflection. In Rendering Techniques 2007 Game Developer Conference (GDC2008), San Francisco, CA,
(Proc. of the Eurographics Symposium on Rendering), 35–44. http://www.ppsloan.org/publications/StupidSH35.pdf.

K ELLER , A. 1997. Instant radiosity. In SIGGRAPH ’97: Proceed- TATARCHUK , N., C HEN , H., E VANS , A., K APLANYAN , A.,
ings of the 24th annual conference on Computer graphics and M OORE , J., J EFFRIES , D., YANG , J., AND E NGEL , W. 2009.
interactive techniques, 49–56. Advances in Real-Time Rendering in 3D Graphics and Games.
In SIGGRAPH’09: ACM SIGGRAPH 2009 courses.
K ŘIVANEK , J., AND C OLBERT, M. 2008. Real-time shading with
filtered importance sampling. Computer Graphics Forum 27, 4, WALTER , B., F ERNANDEZ , S., A RBREE , A., BALA , K.,
1147–1154. D ONIKIAN , M., AND G REENBERG , D. P. 2005. Lightcuts: A
scalable approach to illumination. ACM Transactions on Graphics
L OSASSO , F., AND H OPPE , H. 2004. Geometry clipmaps: terrain (Proc. of SIGGRAPH 2005) 24, 3, 1098–1107.
rendering using nested regular grids. In SIGGRAPH ’04: ACM
SIGGRAPH 2004 Papers, 769–776. WANG , R., WANG , R., Z HOU , K., PAN , M., AND BAO , H. 2009.
An efficient gpu-based approach for interactive global illumina-
M C G UIRE , M., AND L UEBKE , D. 2009. Hardware-accelerated tion. ACM Transactions on Graphics (Proc. of SIGGRAPH 2009)
global illumination by image space photon mapping. In HPG ’09: 28, 3, 1–8.
Proceedings of the Conference on High Performance Graphics
Y U , I., C OX , A., K IM , M. H., R ITSCHEL , T., G ROSCH , T.,
2009, 77–89.
DACHSBACHER , C., AND K AUTZ , J. 2009. Perceptual in-
M ITTRING , M. 2007. Finding Next-Gen: CryEngine 2. In SIG- fluence of approximate visibility in indirect illumination. ACM
GRAPH’07: ACM SIGGRAPH 2007 courses. Transactions on Applied Perception 6, 4, 1–14.

N ICHOLS , G., AND W YMAN , C. 2009. Multiresolution splatting


for indirect illumination. In I3D ’09: Proceedings of the 2009
symposium on Interactive 3D graphics and games, 83–90.
N ICHOLS , G., S HOPF, J., AND W YMAN , C. 2009. Hierarchical
image-space radiosity for interactive global illumination. Com-
puter Graphics Forum 28, 4, 1141–1149.
OAT, C. 2006. Irradiance volumes for real-time rendering. ShaderX
5: Advanced Rendering Techniques.
R AMAMOORTHI , R., AND H ANRAHAN , P. 2001. On the relation-
ship between radiance and irradiance: determining the illumina-
tion from images of a convex lambertian object. J. Opt. Soc. Am.
A 18, 10, 2448–2459.
R AMANKUTTY, M. A., AND C ROSBIE , A. L. 1997. Modified dis-
crete ordinates solution of radiative transfer in two-dimensional
rectangular enclosures. J. Quantitative Spectroscopy Radiative
Transfer 57, 107–140.
R ITSCHEL , T., G ROSCH , T., K IM , M. H., S EIDEL , H.-P., DACHS -
BACHER , C., AND K AUTZ , J. 2008. Imperfect shadow maps for
efficient computation of indirect illumination. ACM Transactions
on Graphics (Proc. of SIGGRAPH Asia) 27, 5.
R ITSCHEL , T., E NGELHARDT, T., G ROSCH , T., S EIDEL , H.-P.,
K AUTZ , J., AND DACHSBACHER , C. 2009. Micro-rendering
for scalable, parallel final gathering. ACM Trans. Graph. (Proc.
SIGGRAPH Asia 2009) 28, 5.
R ITSCHEL , T., G ROSCH , T., AND S EIDEL , H.-P. 2009. Approxi-
mating dynamic global illumination in image space. In I3D ’09:
Proceedings of the 2009 symposium on Interactive 3D graphics
and games, 75–82.
S ILLION , F. 1995. A Unified Hierarchical Algorithm for Global
Illumination with Scattering Volumes and Object Clusters. IEEE
Trans. on Visualization and Computer Graphics 1, 3, 240–254.

You might also like