Real-Time Volume Rendering in Dynamic Lighting Environments Using Precomputed Photon Mapping
Real-Time Volume Rendering in Dynamic Lighting Environments Using Precomputed Photon Mapping
1, JANUARY 2007 1
Abstract—We present a framework for precomputed volume radiance transfer that achieves real-time rendering of global
illumination effects for volume datasets such as multiple scattering, volumetric shadows, etc. Our approach incorporates the
volumetric photon mapping method into the classical precomputed radiance transfer pipeline. We contribute several techniques
for light approximation, radiance transfer precomputation and real-time radiance estimation, which are essential to make the
approach practical and to achieve high frame rates. For light approximation, we propose a new discrete spherical function which
has better performance for construction and evaluation when compared with existing rotational invariant spherical functions such
as spherical harmonics and spherical radial basis functions. In addition, we present a fast splatting-based radiance transfer
precomputation method and an early-evaluation technique for real-time radiance estimation in the clustered PCA space. Our
techniques are validated through comprehensive evaluations and rendering tests. We also apply our rendering approach to
volume visualization.
Index Terms—Volume Rendering, Precomputed Radiance Transfer, Volume Ray Casting, Multiple Scattering, Volume Shadow.
the classic spherical harmonics (SH) basis function for ray marching is performed and at each step the stored
approximating high-frequency lighting, and unlike wavelet photons are gathered to compute the final radiance. This
basis functions, it is also rotationally invariant. In addition, final radiance gathering step can also be computed more
the interpolation property of DSF enables much faster efficiently by photon splatting [14]. The creation and main-
construction and evaluation when compared with spherical tenance of the hierarchical data structure prevents VPM
radial basis functions (SRBF) [4], while the approximation from achieving interactive performance. Even with a GPU-
quality is similar. To summarize, our contributions include: based kd-tree [15], rendering high-frequency volume caus-
• A novel DSF for light approximation, which is rota- tics with tens of millions of photons is still non-trivial. Our
tionally invariant, fast to construct and evaluate, and PVRT method also adopts photon tracing to simulate light
has the ability to approximate high-frequency lighting. transport, and efficiently precomputes the radiant exitance
• A PVRT method that successfully incorporates the for each voxel based on photon splatting.
VPM method into the PRT framework and achieves Basis Function in PRT In the precomputation stage,
efficient and general volume radiance estimation. PRT-based methods simulate complex light transfer and
• A comprehensive performance and quality evaluation approximate the radiance transfer using certain kinds of
of our approach. We also demonstrate its application in basis functions. Then, the radiant exitance can be approx-
interactive scientific and medical volume visualization. imately reconstructed by multiplying the coefficients of
The remainder of this paper is organized as follows. Sec.2 incident lighting and the radiance transfer matrix. Several
describes existing works and Sec.3 reviews the background functions have been successfully applied in PRT, such as
of light transport in participating media. After an overview SH [3], wavelets [16], [17], spherical radial basis functions
of the PVRT method in Sec.4. Sec.5 introduces the new (SRBF) [4], Gaussians [18], etc. Each of these functions
discrete spherical function (DSF) and its properties. Next, has its own pros and cons. The SH basis smoothly re-
Sec.6 and Sec.7 discuss the general procedure for incor- constructs low-frequency lighting effects very well and
porating the VPM technique into the PRT framework as can be freely rotated, but it cannot efficiently represent
well as the final rendering step. Several implementation high-frequency signals. The wavelet basis can represent
details are discussed in Sec.8. The experimental results and all-frequency effects with a small number of coefficients,
a comprehensive evaluation of our method are given in but its rotation is non-trivial and could introduce temporal
Sec.9. Finally, Sec.10 concludes the paper and introduces flickering due to nonlinear reconstruction. The SRBF can
plan for future works. reconstruct all-frequency effects and is easy to rotate, but
its precomputation cost is much higher than that of other
2 R ELATED W ORKS functions. To realize all-frequency rendering, we introduce
a novel discrete spherical function (DSF) that achieves
We refer readers to [5], [6] for a complete survey of volume similar quality to SRBF with much less precompuation.
GI rendering, and to [7], [8] for a comprehensive introduc-
tion of precomputed radiance transfer (PRT) methods. In Precomputation-based Volume GI Rendering Most
this section, we only cover the most relevant works. existing PRT-based methods deal with the light transfer
Offline Volume GI Rendering The rendering of volume between rigid surfaces, and recently some advanced tech-
GI effects is essentially the solution of the radiative transfer niques can additionally handle deformable scenes [19].
equation [9]. Kajiya and Von Herzen [1] presented a two- However, precomputation-based GI rendering for volume
pass ray tracing method. First, to estimate radiance for datasets has received far less attention. Wyman et al. [20]
each voxel, the radiative transfer equation is approximately introduced a method to precompute the GI using SH for
evaluated using spherical harmonics (SH). Thereafter, ray interactive rendering of isosurfaces extracted from volume
marching is performed along view rays to gather the final datasets. Their method supports direct lighting, volumetric
radiance. Since the MS inside the volume usually exhibits shadows and indirect lighting effects with interactively
low-frequency behavior, only the first few SH bases are changing viewpoints, lighting and isovalues. Still, the com-
necessary for generating visually convincing results. Af- plex scattering behavior inside the volume is ignored.
terwards, several methods have been proposed to compute Sharing the same motivation, Beason et al. [21] proposed
numerical solutions of the radiative transfer equation by an enhanced isosurface GI rendering method that further
using either ray tracing [10], [11] or radiosity [12]. These supports translucency and caustics, but this method is
solutions can render various volume GI effects, but the limited to static lighting. Ritschel [22] incorporated a GPU-
computational cost is enormous, so they can only run in based hierarchical visibility approximation into the precom-
offline mode. To improve performance, Stam [13] suggested putation to quickly compute the visibility inside the volume,
to approximate MS effects using the diffusion process, but it only handles low-frequency effects. In comparison,
which can be simulated by either a multi-grid scheme or a our PVRT method can generally support various volume GI
finite-element blob method. Nevertheless, the speed is still effects with few constraints for the input volume dataset.
far from interactive. Furthermore, the precomputation-based routine has also
The volumetric photon mapping (VPM) method [2] was been adopted in the offline rendering of the MS effect in
proposed to render volume caustics. In its first stage, hair [23].
photons are traced through the volume and stored into Real-time Volume GI Rendering Kaplanyan et al. [24]
a hierarchical data structure, like a kd-tree. Afterward, developed a cascaded light propagation volume (LPV)
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 3
(a) Smoke Plume, 300 × 300 × (b) Bone, 512 × 512 × 512, 40fps (c) Smoke Wall, 400 × 300 × 100, (d) Machine Room, 417 × 345 ×
150, 45fps 42fps 60, 47fps
Fig. 1. Examples of real-time rendering including volume GI effects using the PVRT method.
which is much more costly compared with SS, dominates Fig. 2. The pipeline of the PVRT method for rendering
the overall appearance. Recently, Engelhardt et al. [25] multiple scattering.
suggested to create a set of virtual point lights (VPLs)
within the medium and combine the SS contributions from p A 3d point within medium
all VPLs to render MS in real-time. Unfortunately, the pin ,pout Entry/Exit point in medium
limited number of VPLs usually leads to low-frequency x A 3d point
effects. Several GPU-accelerated approaches [26], [27] have ωi , ωo Incident, outgoing radiance direction
been proposed to render high-quality volumetric smoke S Sphere of directions
under low-frequency environment light. For comparison, D(p) Volume density field at p
our PVRT method can render the MS effect under an all- κs (p) Scattering coefficient
frequency environment light in real-time. κa (p) Absorption coefficient
κt (p) Extinction coefficient
Ω(p) Albedo of participating medium
τ (p, x) Transmittance from u to x
τ∞ (p, ω) Transmittance from infinity to x
f (u, ωo , ωi ) scattering phase function at u
Hernell et al. [28] presented an efficient method to Lin (ω) Incoming radiance from light source
compute ambient and emissive tissue illumination, which Lout (x, ω) Outgoing radiance arriving at x
exploits ray casting to determine ambient illumination, and Lri (x, ω) Reduced incident radiance
adopts a multi-resolution volume to speed up rendering. Lm (x, ω) Media radiance
Similarly, to render simple scattering and ambient occlusion J(x, ω) Scattered radiance
for isosurfaces, a GPU-based Monte Carlo ray casting Lre (ω) Radiance exitance function
method was proposed in [29]. When compared with these T Radiant exitance matrix
methods, our PVRT method is superior in its support
for complex scattering, especially MS effects, for general Fig. 3. Nomenclature
volume data formats under complex lighting conditions.
Kniss et al. [30] proposed a shading model to interac-
tively render volumes, which generates volumetric shad- 3 R ADIANCE T RANSPORT IN VOLUMETRIC
ows and forward scattering through translucent materials. M EDIA
Ropinski et al. [31] presented a physically more accurate
optical model for volume rendering, which incorporates Before the introduction of our PVRT method, we briefly
scattering, shadowing and specular reflections. However, review radiance transport in volumetric media. Following
applying these volume shading models to handle complex the definition in [5], the radiance quantities that we use
environmental lighting and general scattering effects is non- are listed in the table of Fig.3. The input volume data
trivial. To render high-quality volume shadows, Kronander is modeled as a sequence of volumetric density fields.
et al. [32] presented a method which encodes local and Regular mesh grids are used to store the volumetric density
global volumetric visibility into an efficient multi-resolution field at cell centers. Considering a 3D position p in the
grid over the extent of the volume to achieve real-time volumetric media (shown in Fig.4), we represent the volume
performance. Compared with it, our PVRT method can density field of p at each frame as D(p), the absorption
generate various volume GI effects, not just shadow, in real- coefficient as κa (p), the scattering coefficient as κs (p), the
time. extinction coefficient as κt (p) = κa (p) + κs (p), and the
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 4
candidates. However, both have disadvantages as well. The each sample requires the processing of hundreds of vari-
SWBFs are not rotationally invariant, which prevents fast ables. For example, if we use 6th order SH for irradiance
rotation of the basis functions. The SRBFs can be freely and 4th order SH for radiant exitance, the size of the
rotated but their construction and evaluation are quite slow radiance transfer matrix is 36 × 16 = 576 and the size of
because the SRBFs do not have the interpolation property the light vector is 36. Then we need to perform a matrix-
and local support. The interpolation property means the vector multiplication of this size for each sample and it
coefficients are equal to the spherical function values at is impossible to evaluate it in real-time for all voxels.
the sampling directions, so that reconstructing the spherical Therefore, we introduce an early-evaluation technique to
function can be rapidly achieved by interpolation. The significantly reduce the rendering cost. It is achieved by
basis functions with local support ensure that only a small using clustered PCA for transfer matrix compression and
number of coefficients are needed for evaluation of the reducing the compressed basis transfer matrices into scalar
spherical function at arbitrary directions. To fulfill these values based on view and lighting changes before decom-
properties, we introduced a new discrete spherical function pression. The technical details are presented in Sec.7.
(DSF) that is rotationally invariant, interpolation-based and In general, as shown in Fig.2, the PVRT method ap-
also has locally supported basis functions. The DSF can proximates the lighting using a set of basis lights and
achieve similar accuracy to the SRBFs for approximating each basis light corresponds to a basis function. During
high-frequency environment light. the precomputation stage, aided by the VPM technique,
The second challenge is how to cast photons. Photon the radiance transfer estimation is performed to compute
casting is simple if all the light sources and geometries the radiant exitance for each voxel. To save storage and
are clearly defined. However, in the PRT pipeline, the improve performance, we further compress the radiant
lighting environment is approximated using a set of basis exitance data for the whole volume. Thereafter, during the
functions, such as SH and DSF. The values of these basis rendering stage, the precomputed radiant exitance data is
functions are distributed nonuniformly and the values can efficiently decompressed and used to compute the final
be either positive or negative. Therefore, we must design view-dependent radiance for each voxel. The PVRT method
a general photon casting scheme for different types of supports both environment light and directional light.
basis functions. To generate photons with correct energy
distributions, instead of casting photons from distant planes 5 D ISCRETE S PHERICAL F UNCTION
facing random directions with direction-dependent casting Before introducing the PVRT method, we first present
rate, we cast photons from the boundary surface of the the discrete spherical function (DSF) that has both the
volume and each photon has a random direction and also a interpolation property and local support.
direction-dependent energy value. This assures that all the 1.5
strategy has been tested and worked well for both SH and 0.5
DSF.
Another challenge is the efficient radiance transfer es- 0
−1.5 −1 −0.5 0 0.5 1 1.5
θ
which is the minimum angular distance between any pair compute the corresponding coefficient for each basis. With
of sampled directions ωki and ωkj in Ω. As shown in Fig.5, these coefficients, afterward we can reconstruct the value of
h can be regarded as the radius of the local impact region the lighting function at arbitrary directions by evaluating the
of each sampled direction. The definition of Wh follows the basis functions. Comparing the reconstructed value with the
kernel definition in smoothed particle hydrodynamics [33], original value can help us verify the accuracy of the lighting
which is widely applied for fluid simulation. Compared approximation. We perform such a lighting reconstruction
with the Gaussian kernel, it has been proven to be more experiment [16] to test the DSF.
efficient for evaluation and has compact support in local
region.
With such a definition, the kernel function Wh has the
following properties:
• Local Support
{
> 0, θij < h
Wh (ωi , ωj )
= 0, θij ≥ h
As shown in Fig.5, Wh provides compact support in
local region.
• Monotonicity
dWh (ωi , ωj )
≤0
dθij
(a) Input EM (b) 162, 13.2% (c) 642, 8.9% (d) 2562, 7.3%
• Interpolation Based on the definition of h, if we pick Fig. 6. Comparison of the approximation accuracy
up any two sampled directions ωki and ωkj in Ω, then using different number DSF bases for a synthetic high-
{
frequency EM (a). The 1st row lists the reconstruction
1, ki = kj
Wh (ωki , ωkj ) = results, and the 2nd row shows the approximation er-
0, ki ̸= kj rors (’red’ and ’blue’ represent the positive and negative
Therefore, Wh guarantees that when ω = ωk , S(ωk ) = values, respectively.). The number of DSF bases and
sk and the DSF function can recover the sampled orig- L2 errors are given for (b) (c) and (d).
nal value. When ω is located between several samples, The initial directional sampling of the DSF is based on
as shown in Fig.5, its value is the interpolation of its icosahedral mesh generation, and the number of samples
neighbor samples (inside red dot circle) weighted by over the sphere Ω can be 42, 162, 642, 2562 . . . depending
Wh . on the order of icosahedral subdivision. To select the
Eq.7 actually represents the reconstruction of the spher- optimal number of the DSF bases to achieve a good
ical function using DSF and sk can be regarded as the balance between approximation quality and performance,
corresponding coefficients for the DSF bases. For other we reconstruct a synthetic high-frequency “checkerboard”
bases, such as SH and SRBF, computing the coefficients environment map (EM) with different numbers of DSF
is a process of projecting the spherical function onto basis bases and compare the results using standard L2 errors
space and such a projection step is usually time-consuming. between the pixels in the original cube map and the
However, for the DSF sk is just a sampling of the spherical pixels in the reconstructed one. As shown in Fig.6, the
function, so the projection step is very efficient. Actually reconstruction quality essentially improves by increasing
computing sk is not a simple point sampling, and to the number of DSF bases. Notice that using 2562 bases
balance the frequency between the spherical function and rather than 642 bases only improves quality by a factor of
the DSF we introduce a prefiltering step for the spherical 1.6%, but multiplies the total number of basis lights by four.
function which will be discussed in Sec.8. Relying on the Therefore, we choose the optimal number of DSF bases to
local support property of DSF, the evaluation of Eq.7 for be 642.
To compare the approximation quality between the DSF
arbitrary directions can be efficiently computed because
and other existing bases, in Fig.7, we test the lighting
only a limited number of bases need to be considered.
reconstruction for both synthetic and real EM lights using
The definition of the DSF basis w̄k (ω) is a normalized
different bases with a similar number of basis functions.
weight for local interpolation, so w̄k (ω) is invariant during
Clearly, DSF can achieve the best approximation quality
the rotation of the spherical function. Therefore, when
with lowest L2 error. To verify the high-frequency render-
rotating the environment light, we only need to rotate the
ing effects using different bases, in Fig.8 we test the shadow
prefiltered environment light and sample it again to get the
effects under directional light. It is obvious that using a
new coefficient sk , which is simple and efficient.
low-frequency SH basis misses the high-frequency shadow
details and the ringing artifacts of SH darken the whole
5.2 Lighting Approximation Using DSF scene. Both DSF and SRBF achieve good high-frequency
To approximate the lighting using this basis function, we shadow effects.
project the original lighting function onto basis space and The statistical results in our experiments show that
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 7
dealing with an arbitrary EM light with size 6 × 256 × 256, 6.2 Direct Illumination
for each SH, SRBF and DSF basis, the average timing of For direct illumination, the incident energy for each voxel
the projection step is 539ms, 91ms, 2ms, respectively, and is just the reduced radiance Lri (Eq.2), so photon tracing is
the average timing of evaluation for an arbitrary direction unnecessary for its precomputation. For a voxel at position
is 0.369ms, 0.059ms, 0.013ms, respectively. It is clear that p, when using the SH or DSF basis to approximate incident
SH is the most time-consuming basis for both projection lighting, the incident reduced radiance in ωi from each basis
and evaluation, and hence normally we should not use many light can be computed as Lri (p, ωi ) = τ∞ (p, ωi )Ylm (ωi )
SH bases to approximate high-frequency functions. SRBF or Lri (p, ωi ) = τ∞ (p, ωi )w̄k (ωi ). In the precomputation
computation involves numerical integration [4], and there- stage, for each basis light we uniformly sample Ns di-
fore its time cost is much higher than the DSF, especially rections either over a unit sphere (for SH) or inside a
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 8
small solid angle around the current basis light (for DSF). with high-frequency lighting, rather than distributing pho-
Considering all the Lri s from Ns directions, each Lri is ton’s direction ω over the whole unit sphere, we may restrict
multiplied with the phase function value at the current the ω inside a small differential solid angle for each DSF
voxel position to get the radiant exitance Lre . As mentioned basis light. Therefore, although the number of DSF bases
above, Lre , which is a 2D spherical function, is non-trivial is usually much higher than the number of SH bases, much
to store directly. Therefore, we use SH to approximate fewer photons are actually needed for each DSF basis light.
Lre with good accuracy. For each basis light, the radiant
exitance of each voxel can thus be approximated and stored 6.3.2 Volumetric Photon Tracing
as a vector. After processing all basis lights, the radiant Starting from the boundary voxel, the photons travel
exitance of each voxel finally forms a radiant exitance through the volume with a pre-defined step size. At each
matrix. Methods for determining the value of Ns will be step, a photon can either pass unaffected through the
discussed in Sec.8. medium inside current voxel, or be scattered or absorbed.
We choose the side length of the voxel ∆l as step size for
6.3 Global Illumination using VPM photon propagation so that the maximum number of poten-
In this section, we focus on how to address the second tial steps matches the volume resolution. The probability
and third challenges that are mentioned in Sec.4 for the of an absorption or scattering event occurring at point p is
seamless incorporation of the VPM method into the PRT integrated along the photon path from the entry point pin
framework and the achievement of efficient precomputation to p:
{ ∫ p }
for the rendering of volume GI effects.
P (p) = 1 − exp − (σa + σs )ρ(x)dx (13)
pin
6.3.1 Volume Photon Sampling under Spherical
Lighting where ρ is the density field function for volume media,
As is the case for the standard VPM method, the first step which is often obtained from the original volume data
is to generate the photons for each basis light. Our basic through a user-defined mapping. σa and σs are absorption
idea is to cast photons at the boundary cells (voxels) of and scattering coefficients, respectively. When a random
the volume with varying flux energy for each photon. The number 0 ≤ X ≤ 1 satisfies X ≤ P , Russian Roulette is
photon generation fulfills the following requirements: (1) used to determine whether it is an absorption or scattering
the initial directions of all the generated photons in each event based on the probability values σa /(σa + σs ) and
boundary voxel are uniformly distributed on the unit sphere, σs /(σa + σs ). The new scattering direction of a photon
and (2) each photon’s energy is proportional to the radiance is chosen using importance sampling based on the phase
from the basis light in the photon’s direction. As shown in function within the current voxel [2], and arbitrary phase
functions can be supported in our method.
∑
Q
cluster index k and N = 4 PCA floating point coefficients.
W (d)Φp (ω)f (x, ωo , ω), where Q is the number of the
p=0 For each matrix cluster, we also store the mean matrix
neighboring photons. Again, we use SH to approximate Tmean and N = 4 basis matrices. Overall, such a strategy
Lre (ωo ) and the radiant exitance of each voxel is approx- saves lots of storage and also ensures real-time performance
imated and stored as a vector. With the radiant exitance for further radiance estimation in the ray casting step. The
for each voxel, we can evaluate the incident radiance for accuracy of our compression strategy is discussed in Sec.9.
arbitrary view rays in the subsequent volume ray casting
process. 7 R EAL - TIME VOLUME R ENDERING
The major steps in the real-time rendering stage consist
6.4 The Radiant Exitance Matrix and Its Compres- of (1) view-dependent volume radiance estimation, and (2)
sion volume ray casting. All the operations in the rendering stage
For each voxel, the radiant exitance under each basis light can be efficiently performed on the GPU.
is represented as a vector with length n. After processing
m basis lights, the radiant exitance from all the basis 7.1 Lighting Approximation
lights forms a m × n matrix T , called the radiant exitance
Incident lighting is projected into basis function space,
matrix, which can be regarded as a linear transformation
either SH or DSF, and can be represented as a vector of
that transforms the input lighting vector Lin into final
projection coefficients Lin . This is a standard step in PRT-
radiant exitance vector Ie :
based methods and is performed in each frame.
Ie = T Lin (15)
Here the length of Lin and Ie is m and n, respectively, 7.2 View-dependent Volume Radiance Estimation
which represent the number of used bases. Computing T After updating the lighting environment, in each cluster k,
for each voxel is the major task during the precomputation we multiply the new light coefficient vector Lin to the mean
k
stage. If using a 6th order SH for the environment light matrix Tmean as well as all the basis transfer matrices Tik .
and a 4th order SH for the anisotropic phase function (i.e. ∑
N
m = 36 and n = 16 ), the dimension of T will be 36 × 16. k
Imean k
= Tmean Lin Iik = Tik Lin (18)
Storing a 36 × 16 matrix for each voxel is impractical, so i=1
we need to further compress the precomputated data. k
where Imean and Iik represent the transferred mean and
We adopt the clustered principal component analysis
basis radiant exitance vector of the kth cluster, respectively.
(CPCA) method [34] to achieve further compression. All
The final radiance vector Ie at voxel t can be recovered by:
the matrices of the voxels are first clustered in signal space
using vector quantization. Note that empty voxels with zero ∑
N
k
density gradients are excluded from the clustering and zero Ie = Imean + wit Iik (19)
weights are assigned directly. The total number of clusters i=1
are adjustable by compromising between quality and speed, where wit is the PCA coefficients for voxel t. The straight-
and a relatively optimal cluster number is 128 based on forward strategy is to store the Ie for each voxel for further
our experiments (Sec.9). Thereafter, within each cluster, the radiance estimation. However, Ie is a vector of length n and
standard principal component analysis (PCA) is performed directly saving it for all voxels requires n × Sizevolume
to compute the mean matrix, the set of the basis matrices GPU memory, which is costly. Furthermore, evaluating
and the set of corresponding coefficients for each voxel’s Eq.19 is also inefficient for all the voxels in each frame.
radiant exitance matrix. Using CPCA, the transfer matrix Notice that in each frame the current view info is known
T at a certain voxel t can be approximated through before volume ray casting. As shown in Line 22 − 26 in
∑
N Algorithm 1, for the kth cluster we can first compute the
T ≈ Tmean
k
+ wit Tik (16) view-dependent radiance value LkV for Imeank
and each Iik ,
i=1 respectively, by evaluating the basis functions with the view
direction. When using the SH basis, IVk is computed as
where k is the index of the cluster that t belongs to, Tmean
(using Eq.9):
is the mean matrix of the kth cluster, Tik is the ith PCA
basis matrix, and wit is the corresponding coefficient. N ∑
s−1 ∑
l
is the number of PCA basis transfer matrices, and our LkV = Il(l+1)+t+1 Ylt (ωx→xV ) (20)
experiments demonstrate that N = 4 works well in most l=0 t=−l
cases (Sec.9). Putting Eq.16 into Eq.15, the linear radiance when using DSF basis, it is computed as (using Eq.10):
transformation at each voxel is approximated as:
∑
n
∑
N LkV = w̄k (ωx→xV )sk (21)
Ie ≈ (Tmean
k
+ wik Tik )Lin . (17) k=1
i=1 where x → xV is a unit vector from voxel position x to
After the CPCA compression, the storage of the precom- current view point xV . Thereafter, for each voxel, its view-
putation results of each voxel includes only one integer dependent radiance value LV can be efficiently computed
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 10
as the linear combination of the LkV s weighted by the PCA 8.3 Number of Photons for Each Voxel
coefficients of current voxel. With such an early-evaluation In the PVRT method, the photons are emitted from bound-
strategy, we only need to save one floating point value for ary voxels and the number of photons per voxel NP is
each voxel, and the storage for all the voxels is reduced to controlled by the user. NP affects the rendering quality
be just one additional radiance volume texture. and it scales well as the resolution of the input volume
dataset changes. For example, if we set NP to be 100, a
1003 volume would cast 6 × 1003 = 6 million photons
7.3 Volume Ray Casting in total because there are only 6 × 1002 boundary voxels.
The aforementioned radiance estimation for each voxel As discussed in Sec.6.3.1, when using DSF NP is much
leads to a very simple ray casting stage. The traditional smaller compared with using SH. Based on our experimen-
GPU-based volume ray casting method [35] can be applied tal results, we found that NP = 10 and NP = 100 achieve
to render the volume data. In addition, we just need to a good balance between quality and speed for DSF and SH,
sample the radiance LV from the radiance volume texture respectively. More results and discussions will be shown in
at each sampling point along the ray. Sec. 9.
⃝R
terpolation. Then, the directional light can be approximated i7 740QM 1.73GHz CPU, an NVIDIA Geforce GTX
by the linear combination of the three DSF basis lights. 460M GPU and 6GB of physical memory. All the results,
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 11
if not specifically mentioned, utilize DSF with 642 bases truth. The first row shows the results with only direct
to approximate incident lighting. The number of CPCA illumination from SS, and the second row shows the full GI
clusters is 128, and the number of PCA bases is 4. with both SS and MS. Visually, we can clearly distinguish
TABLE 1 the difference between with and without volumetric GI
Performance data. effects. The difference images show that our results are very
VolData DataRes
NumP Prep RV Render close to the references. To compare the accuracy of different
(mil.) (sec.) (ms) (ms) basis functions, Fig.11 shows the comparison between the
Smoke Plume 300 × 300 × 150 3.6 110 0.8 20
Smoke Wall 400 × 300 × 100 3.8 165 0.8 23 references and the results generated by the PVRT method
Aneurism 256 × 256 × 256 3.9 81 0.9 19 using different bases. In the first row, we utilized a synthetic
Bonsai 256 × 256 × 256 3.9 113 0.9 20 environment light with three spherical lights in different
Bone 512 × 512 × 512 7.9 241 1 23
Part 504 × 504 × 228 9.7 395 1 25 colors, and in the second row we adopted a real EM. It
Machine Room 417 × 345 × 60 3 73 0.7 21 is easy to notice that DSF reaches the best visual quality
The performance timings for different datasets are listed compared with other bases, especially SH. The L2 errors
in Table 1. As shown, the number of sampled photons also numerically demonstrate this conclusion. To verify the
(col. NumP) increases as the resolution of volume dataset
increases. The precomputation time (col. Prep) is related to
both the number of photons and the density field occupation
inside the volume that determines the effective voxels
during ray/photon marching. Usually, more photons de-
mand more precomputation time. Note, the precomputation (a) 209 × 173 × 30 (b) 417 × 345 × 60 (c) Diff(10x)
time listed in Table 1 includes the timings of both single Fig. 12. Comparison of volume GI rendering with
(SS) and multiple scattering (MS). The PVRT method different volume resolution.
aims at handling high-resolution volumes, and even with quality loss of using CPCA compression, we compared the
a 504 × 504 × 228 volume, the precomputation time is rendering of a smoke dataset, wherein density distribution
just around 6.5 minutes. Also note that the current test is random , using different numbers of CPCA clusters. The
GPU is designed for laptops, and thus has much weaker statistical data is shown in Table 2, which shows that using
performance when compared with the PC version. With 128 clusters only introduces 0.1% more L2 error compared
state-of-the-art GPUs, our precomputation performance is with using 256 clusters, while the CPCA compression
expected to be further improved by at least a factor of 3. using 256 clusters spends almost double the time compared
For the rendering stage, the step of generating the radiance with using 128 clusters. Hence, using 128 clusters for
volume texture is very efficient, and for all datasets we CPCA compression is optimal to achieve a good balance
tested it only takes around 1 ms (col. RV). Relying on the between performance and quality. To test the impact of
radiance volume texture, the following ray marching can
be performed in real-time (col. Render).
22
20
18
16
14
12
10
0 1 2
10 10 10
(d) VPM,SS+MS (e) DSF,SS+MS (f) Diff(25x) Fig. 13. Comparison of using different number of
photons.
Fig. 10. Comparison between the ground truth gener-
ated by VPM and our results using DSF. different input volume resolutions on the rendering quality,
we spatially down-sampled the machine room dataset to
TABLE 2
half the resolution, and rendered it using directional light.
Statistics of different number of CPCA clusters.
Since the resolution decreases, the total number of photons
No. Cluster L2 CPCA Time (s)
and the precomputation time is reduced to be 0.75 mil. and
32 2.2% 12
64 1.3% 19 21 sec., respectively, compared with the original dataset
128 0.9% 31 (Table 1). Yet, as shown in Fig.12, the rendering quality
256 0.8% 52 also declines and the L2 error from the result using high-
To validate the accuracy of our method, Fig.10 gives resolution volume is 4.3%. As mentioned in Sec.8.3, when
a comparison between our results using DSF and the using DSF, each boundary voxel shoots NP = 10 photons
references generated by VPM, which is treated as ground for each basis light. To verify the quality, in Fig.13, we
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 12
(a) VPM (b) DSF, 642, 3.78% (c) SRBF, 642, 6.78% (d) SH, 676, 10.96%
(e) VPM (f) DSF, 642, 1.27% (g) SRBF, 642, 2.24% (h) SH, 676, 3.62%
Fig. 11. Comparison between the references generated by VPM and the results using different bases.
compared the rendering results using NP = 1 and NP = 10 features and hence provides a much better perception.
with the reference. This resolution of this Pillars volume is Therefore, along with the real-time performance, the PVRT
1003 , and hence the total number of boundary voxels is method offers high potential for improving the scientific
6 × 1002 . Since the VPM strategy only contributes to the and medical visualization quality.
indirect illumination of the final rendering, visually it is not Limitations In the precomputation stage of the PVRT
easy to distinguish the differences between using different method, the physical properties of each voxel, such as
numbers of photons. However, the difference images (10x) density field value, phase function, etc, can impact the
and the L2 errors clearly show the accuracy difference. transport of each photon and determine the final radiant
Since when using NP = 10 photons, the L2 error is below exitance. Therefore, although we can render the volumetric
1%, and hence it provides sufficient visual quality at good effects in real-time, the physical properties of each voxel
performance. Further, Fig.13 (d) illustrates the trend of the cannot be changed during rendering because the radiance
precomputation time as a function of number of photons for transportation is precomputed. Also the indirect light trans-
each boundary voxel, which yields almost a linear curve. portation does not change according to the change of opac-
We applied the PVRT method for various visualization ity mapping. However, since photon tracing is pursued for
scenarios. Fig.14 shows three study cases where our ren- each basis light, the basis coefficients for current lighting
derer is used for volume visualization. The first row shows can be freely changed. Hence we can support dynamic
the rendering of a bone volume dataset using conventional lighting, view and color transfer function change, in real-
volume ray casting with local shading and our method time (as shown in the accompanying video).
(using DSF) with volume GI effects. In the first image,
it is obvious that certain features, such as the spatial
structure of the spine, cannot be clearly perceived under
10 C ONCLUSION AND F UTURE W ORKS
direct illumination. However, these features are correctly In this paper, we present a precomputed volume radiance
presented using our method with volume GI. In addition, transfer (PVRT) method that is feasible to incorporate
by using both key light and back light, MS effects from global illumination at real-time rates for rendering volume
the back light offer better perception of the structure data. The added realism and clarity can greatly benefit
within the spine. The second and third dataset is a CT practical visualization tasks. To simulate time-consuming
scan of a bonsai tree and an aneurysm, respectively. It is multiple scattering, the PVRT method incorporates the vol-
noticeable that our result looks more 3D and provides a umetric photon mapping technique into the precomputation
much better visual perception of the depth order of complex stage, and introduces a novel photon sampling strategy and
leaves or vessel structures. To demonstrate whether the photon splatting routine to compute the radiant exitance
high-frequency lighting is meaningful for visualization, in for each voxel. Our PVRT framework currently supports
Fig.15, we tested the part dataset under environment light both distant spherical lighting and local directional lighting.
that is approximated using 6th SH and DSF with 642 To approximate all-frequency lighting, we further present
bases, respectively. From this test, we can easily see that the discrete spherical functions (DSF), which has a local
the rendering using low-frequency lighting smoothes out a interpolation property and is accurate and efficient for
great deal of the spatial features over the volume (shown in reconstruction. The PVRT method is practical for rendering
the yellow square), while the volume rendering results with high quality volume GI effects for various high-resolution
high-frequency lighting preserves the important volume volume datasets. Our experimental results demonstrate its
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 13
(a) LI, Key Light (b) GI, Key Light (c) GI, Key & Back Light
Fig. 15. Comparison of volume GI rendering for visualization between using low-frequency SH (left column) and
using high-frequency DSF (right column).
merits and show that it can benefit both interactive graphics DE-FC02-12ER26072, program manager Lucy Nowell. We
and scientific visualization applications. would like to thank volvis.org for the volume data and Paul
For future work, we aim at removing the current con- Debevec for the environment maps. Finally, we sincerely
straint of fixing the volume physical properties in pre- thank the reviewers and Bob Miller for helping improve
computation so that the user can interactively edit the the manuscript.
volume dataset. Further, since the PVRT method inherits the
routine of VPM, it inherently could support the rendering R EFERENCES
of volume caustics. As a next step, we would thus like to
[1] J. T. Kajiya and B. P. Von Herzen, “Ray tracing volume densities,”
investigate high-quality volume caustics rendering using the SIGGRAPH Comput. Graph., vol. 18, pp. 165–174, 1984.
PVRT method. [2] H. W. Jensen and P. H. Christensen, “Efficient simulation of light
transport in scences with participating media using photon maps,”
ACKNOWLEDGMENTS [3]
in Proc. of SIGGRAPH. ACM, 1998, pp. 311–320.
P.-P. Sloan, J. Kautz, and J. Snyder, “Precomputed radiance transfer
This research was sponsored in part by the U.S. National for real-time rendering in dynamic, low-frequency lighting environ-
Science Foundation through grants OCI 0905008, OCI ments,” ACM Trans. Graph., vol. 21, pp. 527–536, 2002.
[4] Y.-T. Tsai and Z.-C. Shih, “All-frequency precomputed radiance
0850566, and OCI 0749227, and also by the U.S. Depart- transfer using spherical radial basis functions and clustered tensor
ment of Energy through grants DE-FC02-06ER25777 and approximation,” ACM Trans. Graph., vol. 25, pp. 967–976, 2006.
JOURNAL OF LATEX CLASS FILES, VOL. 6, NO. 1, JANUARY 2007 14
[5] E. Cerezo, F. Perez-Cazorla, X. Pueyo, F. Seron, and F. Sillion, [32] J. Kronander, D. Jönsson, J. Low, P. Ljung, A. Ynnerman, and
“A survey on participating media rendering techniques,” the Visual J. Unger, “Efficient visibility encoding for dynamic illumination in
Computer, 2005. direct volume rendering,” To Appear in IEEE Trans. Vis. Comput.
[6] M. Hadwiger, P. Ljung, C. R. Salama, and T. Ropinski, “Advanced Graph., 2011.
illumination techniques for gpu volume raycasting,” in ACM SIG- [33] M. Müller, D. Charypar, and M. Gross, “Particle-based fluid sim-
GRAPH ASIA 2008 courses, 2008, pp. 1:1–1:166. ulation for interactive applications,” in Proc. of SCA’03, 2003, pp.
[7] J. Kautz, P.-P. Sloan, and J. Lehtinen, “Precomputed radiance trans- 154–159.
fer: theory and practice,” in ACM SIGGRAPH Courses. ACM, [34] P.-P. Sloan, J. Hall, J. Hart, and J. Snyder, “Clustered principal
2005. components for precomputed radiance transfer,” ACM Trans. Graph.,
[8] R. Ramamoorthi, “Precomputation-based rendering,” Foundations vol. 22, no. 3, pp. 382–391, 2003.
and Trends in Computer Graphics and Vision, vol. 3, no. 4, pp. [35] J. Kruger and R. Westermann, “Acceleration techniques for gpu-
281–369, 2009. based volume rendering,” in Proc. of IEEE Visualization 2003
[9] S. Chandrasekhar, Radiative Transfer. New York: Dover Publica- (VIS’03), 2003, pp. 287–292.
tions, 1960. [36] NVIDIA, “Cuda programming guide,” 2011,
[10] M. Levoy, “Efficient ray tracing of volume data,” ACM Trans. http://developer.nvidia.com/cuda-downloads.
Graph., vol. 9, pp. 245–261, 1990.
[11] E. P. Lafortune and Y. D. Willems, “Rendering participating media
with bidirectional path tracing,” in Proc. of EGWR, 1996, pp. 91–
100.
[12] H. E. Rushmeier and K. E. Torrance, “The zonal method for calcu-
lating light intensities in the presence of a participating medium,”
SIGGRAPH Comput. Graph., vol. 21, pp. 293–302, 1987.
Yubo Zhang is a Ph.D student of computer
[13] J. Stam, “Multiple scattering as a diffusion process,” in Proc. of
science at the University of California, Davis.
EGWR, 1995, pp. 41–50.
He received his M.Phil. degree in applied
[14] A. Boudet, P. Pitot, D. Pratmarty, and M. Paulin, “Photon splatting
mathematics from Hong Kong Baptist Uni-
for participating media,” in Proc. of GRAPHITE, 2005, pp. 197–204.
versity in 2009 and B.S. degree in compu-
[15] K. Zhou, Q. Hou, R. Wang, and B. Guo, “Real-time kd-tree
tational mathematics from Zhejiang Univer-
construction on graphics hardware,” ACM Trans. Graph., vol. 27,
sity in 2007. His current research interests
pp. 126:1–126:11, 2008.
include scientific visualization, volume ren-
[16] R. Ng, R. Ramamoorthi, and P. Hanrahan, “All-frequency shad- dering and physically-based animation.
ows using non-linear wavelet lighting approximation,” ACM Trans.
Graph., vol. 22, pp. 376–381, 2003.
[17] W.-C. Ma, C.-T. Hsiao, K.-Y. Lee, Y.-Y. Chuang, and B.-Y. Chen,
“Real-time triple product relighting using spherical local-frame pa-
rameterization,” Vis. Comput., vol. 22, no. 9, pp. 682–692, Sep. 2006.
[18] P. Green, J. Kautz, W. Matusik, and F. Durand, “View-dependent
precomputed light transport using nonlinear gaussian function ap-
proximations,” in Proc. of I3D, 2006, pp. 7–14.
[19] K. Zhou, Y. Hu, S. Lin, B. Guo, and H.-Y. Shum, “Precomputed Zhao Dong is a postdoc at Program of Com-
shadow fields for dynamic scenes,” ACM Trans. Graph., vol. 24, puter Graphics of Cornell University. He re-
no. 3, pp. 1196–1201, Jul. 2005. ceived his Ph.D. degree in Computer Graph-
[20] C. Wyman, S. Parker, P. Shirley, and C. Hansen, “Interactive display ics from Max-Planck-Institut Informatik, Ger-
of isosurfaces with global illumination,” IEEE Trans. Vis. Comp. many in 2011, and M.S. and B.S degrees
Graph., vol. 12, no. 2, pp. 186–196, Mar. 2006. from Zhejiang University, China, in 2005 and
[21] K. M. Beason, J. Grant, D. C. Banks, B. Futch, and M. Y. Hussaini, 2001, respectively. His current research in-
“Pre-computed illumination for isosurfaces,” in Proc. of Visualization terests include real-time global illumination
and Data Analysis, 2006, pp. 98–108. rendering, physically-based material mod-
[22] T. Ritschel, “Fast gpu-based visibility computation for natural illu- elling and rendering, and volume graphics.
mination of volume data sets,” in Proc. of Eurographics, 17-20, Ed.,
2007.
[23] J. T. Moon, B. Walter, and S. Marschner, “Efficient multiple scatter-
ing in hair using spherical harmonics,” ACM Trans. Graph., vol. 27,
pp. 31:1–31:7, 2008.
[24] A. Kaplanyan and C. Dachsbacher, “Cascaded light propagation
volumes for real-time indirect illumination,” in Proc. of I3D. ACM,
2010, pp. 99–107.
[25] T. Engelhardt, J. Novak, and C. Dachsbacher, “Instant multiple Kwan-Liu Ma an IEEE Fellow, is a profes-
scattering for interactive rendering of heterogeneous participating sor of computer science and the chair of
media,” Karlsruhe Institut of Technology, Tech. Rep., December the Graduate Group in Computer Science
2010. (GGCS) at the University of California, Davis.
He leads the VIDi research group and di-
[26] K. Zhou, Z. Ren, S. Lin, H. Bao, B. Guo, and H.-Y. Shum,
rects the UC Davis Center for Visualization.
“Real-time smoke rendering using compensated ray marching,” ACM
Professor Ma received his PhD degree in
Trans. Graph., vol. 27, pp. 36:1–36:12, 2008.
computer science from the University of Utah
[27] Z. Ren, K. Zhou, S. Lin, and B. Guo, “Gradient-based interpolation
in 1993. He was a recipient of the PECASE
and sampling for real-time rendering of inhomogeneous, single-
award in 2000. His research interests include
scattering media,” Computer Graphics Forum, pp. 1945–1953, 2008.
visualization, high-performance computing,
[28] F. Hernell, P. Ljung, and A. Ynnerman, “Efficient Ambient and Emis- computer graphics, and user interface design. Professor Ma was a
sive Tissue Illumination using Local Occlusion in Multiresolution paper chair of the IEEE Visualization Conference in 2008 and 2009,
Volume Rendering,” in IEEE/EG Volume Graphics, 2007. and an associate editor of IEEE TVCG (2007-2011). He is a founding
[29] C. R. Salama, “Gpu-based monte-carlo volume raycasting,” in Proc. member of the IEEE Pacific Visualization Symposium and the IEEE
of Pacific Graphics, 2007, pp. 411–414. Symposium on Large Data Analysis and Visualization. Professor Ma
[30] J. Kniss, S. Premoze, C. Hansen, P. Shirley, and A. McPherson, “A presently serves on the editorial boards of the IEEE CG&A, the
model for volume lighting and modeling,” IEEE Trans. Vis. Comp. Journal of Computational Science and Discoveries, and the Journal
Graph., vol. 9, no. 2, pp. 150–162, Apr. 2003. of Visualization. Contact him via email: [email protected].
[31] T. Ropinski, C. Döring, and C. Rezk-Salama, “Interactive volumetric
lighting simulating scattering and shadowing,” in Proc. of PacificVis,
2010, pp. 169–176.