Translucent Shadow Maps
Translucent Shadow Maps
Translucent Shadow Maps
Abstract
Shadow maps are a very efficient means to add shadows to arbitrary scenes. In this paper, we introduce Translu-
cent Shadow Maps, an extension to shadow maps which allows very efficient rendering of sub-surface scatter-
ing. Translucent Shadow Maps contain depth and incident light information. Sub-surface scattering is computed
on-the-fly during rendering by filtering the shadow map neighborhood. This filtering is done efficiently using a
hierarchical approach. We describe optimizations for an implementation of Translucent Shadow Maps on contem-
porary graphics hardware, that can render complex translucent objects with varying light and material properties
in real-time.
Categories and Subject Descriptors (according to ACM CCS): I.3.7 [Computer Graphics]: Color, shading, shadow-
ing, and texture
197
Dachsbacher et al / Translucent Shadow Maps
al.3 , a model has been presented that adds sub-surface scat- object to xout . This 4D-function does not only depend on
tering effects for the special case of layered surfaces. Jensen ||xout − xin ||, but also on the angle between xout − xin and the
at al.6 presented a more general model for light reflection on surface normal in xin :
solid translucent objects, based on BSSRDFs (bidirectional Z
surface scattering distribution function), which are a gen- B(xout ) = E(xin )Rd (xin , xout )dxin (2)
S
eralization of BRDFs with possibly distinct light incidence
and exitance points. The higher dimensionality of BSSRDFs In this integral it is assumed that the path from xin to xout
compared to BRDFs results in longer computation times, is completely within the object, which is in general the case
but the method is still much faster than a full Monte-Carlo only for convex objects. So errors occur for concave objects,
simulation. A more rapid, hierarchical evaluation technique however, in practice this kind of error is often visually not
for this model was introduced by Jensen et al.4 . The separa- important. Finally the light leaves the object, again weighted
tion of incident light computation and BSSRDF integration by Ft :
as well as a hierarchical integration technique dramatically 1
L(xout , ωout ) = Ft (η, ωout )B(xout ) (3)
reduce computation time to a few seconds. Although this π
strategy is similar to the method presented in this paper, we
accomplish this concept in a completely different way. By The simulation path is also depicted in Fig. 1.
using a shadow map as intermediate irradiance representa-
tion, we are restricted to illumination from point or parallel
light sources, however, the computation of the irradiance and
the hierarchical integration are even more simplified and can
be completely passed to the graphics processing unit (GPU).
Another accelerated computation technique for Jensen’s
BSSRDF model has been presented by Lensch et al.7 . In
this paper, the authors use a mixture of radiosity-like fi-
nite element computations and texture filtering to evaluate
the BSSRDF integral. The method requires significant pre-
computation for a texture atlas, form factors, and filter ker-
nels. After this, the models can be rendered interactively
with moving light sources at several frames per second. Figure 1: Computing translucency by integration.
198
Dachsbacher et al / Translucent Shadow Maps
Figure 4: Filtering the TSM. Left: computing R, ∆x and ∆y Figure 5: Quantities and equations describing the BSSRDF
from the TSM. Right: Sampling pattern. diffusion term.
199
Dachsbacher et al / Translucent Shadow Maps
targets: in the first one we store the amount of light pene- xout . Note that small values of T are treated in the local
trating the materials boundary (in the red, green and blue response and are excluded in this context by adapting the
component). This fraction is described by the Fresnel term lookup texture appropriately.
which we approximate as proposed by Schlick9 . The sec-
The third texture coordinate R enumerates the 21 samples
ond render target contains the distance from the light source
from our hierarchical sampling scheme. Each sample has
to the visible surfaces, thus the light space depth-buffer,
constant offset relative to (u, v)T and a particular mip-map
which corresponds to a standard shadow map. Furthermore
bias value for the TSM lookup. If our light source is parallel,
the 2D-projection of the (normalized) surface normals onto
(rx , ry ) is constant for every sample and can thus be assumed
the plane orthogonal to the lights’ direction is stored as color.
to be constant within each texture slice with R = const. This
Since visible surfaces (in the Translucent Shadow Map) are
quantization trick is not possible with point lights, in this
oriented towards the light direction, this information suffices
case more intricate computations become necessary.
to reconstruct the surface normal.
All this ends up in a three dimensional texture consist-
In the subsequent rendering passes we evaluate the local
ing of 21 slices. Each slice contains for a particular sam-
and global response for each surface point xout rendered in
ple of our sampling scheme the filter value Rd (xin , xout ) for
the camera view. The point’s coordinates are transformed
all possible quantized normals (first slice dimension) and rz
into light space to determine its texture coordinates (u, v)T in
(second slice dimension).
the Translucent Shadow Map and its distance d to the light
source. The texture slices of the material property 3D texture con-
tain only low frequency color gradients. Therefore, a low
The local response is determined by an image filter with
resolution 3D texture of the size 64 × 64 × 32 for each type
a size of 7 × 7 texels where the neighborhood of (u, v)T
of material proved to be sufficient. Note that the third di-
serves as input. The incoming radiance at the neighboring
mension of the texture has an extent of 32, which is the
texels only contributes to the outgoing radiance, if the texel’s
next power of two to 21. It is generated in a pre-processing
depth values lies within a certain proximity to d. If the stored
step during initialization in approximately 150ms on a Pen-
depth value at (u, v)T is significantly smaller than d, then the
tium 4 processor with 2.4GHz, so material properties can be
currently processed surface point is shadowed by the sur-
changed interactively with almost no delay.
face part represented by this texel. All contributing texels
are summed up using constant, precomputed weights, ignor-
ing depth difference. In the rendering passes for the local re- Model FPS #Vertices #Triangles
sponse we also calculate the local illumination depending on
the Fresnel term for reflected light. All this work is done by a Simple Cube 99.7 8 12
vertex and a fragment program. The number of required ren- Triceratops 80.0 2832 5660
dering passes depends on the deployed graphics hardware. Horse-10k 50.2 5068 10132
Horse-100k 10.0 48485 96966
For the global response the incoming light from the hemi-
Bunny-10k 30.5 5187 10370
sphere (pointing inward the object) of xout needs to be cal-
Bunny-70k 11.9 35947 69451
culated. The sub-surface light transport from a surface point
Bird-54k 15.3 27002 54000
xin to xout is evaluated according to the formulae in Fig. 5.
Bird-100k 9.6 48668 97332
It depends on the vector R = xin − xout and the normal
Max Planck 14.2 25044 49999
N = (nx , ny , nz )T at xin . Although this function could be
Max Planck II 5.7 100086 199996
computed per fragment, we use a pre-computed, quantized
version, which can be quickly evaluated as a texture lookup. Table 1: This table lists the frames per second at a resolution
Considering the fact that only textures up to a dimension of of 512 × 512 and the number of vertices and triangles for
three are provided by graphic hardware, we need to reduce models we tested with our implementation.
the five input dimensions (R is 3D, N is 2D) to three.
The first dimension reduction – and so the first texture
coordinate S – is obtained by quantizing the surface normal 5. Results
bw( 1 n + 1 )c+frac( 1 n + 1 )
2 x 2 2 y 2
at xin with: w with frac(x) = x − bxc.
Table 1 shows the performance of our implementation of
The variable w represents the half resolution (in texels) of
the Translucent Shadow Map method using a resolution of
the texture in the S dimension. It is necessary to defer the
512 × 512 for the shadow map and the camera view. The
quantizing of the normal to this stage, because we want to
timings were collected on an Intel Pentium 4 Processor with
obtain mip-mapped normals from the Translucent Shadow
2.4GHz and an ATI Radeon 9700 graphics card. Note that
Map.
the object and the light source can be moved interactively
As second texture coordinate T we use the z-component and freely by the user. Complex objects can be rendered at
of R which is the difference of the depth values of xin and interactive frame rates, simpler objects in real-time. In the
200
Dachsbacher et al / Translucent Shadow Maps
first case the rendering speed is limited by the vertex pro- ceedings, Annual Conference Series, pages 165–174,
cessing of the GPU because we need multiple render-passes, August 1993. 2
due to the limited number of instructions and texture look-
4. Henrik Wann Jensen and Juan Buhler. A rapid hier-
ups in the fragment processing stage. For simpler objects
archical rendering technique for translucent materials.
the frame rate is bounded by the fragment processing speed.
ACM Transactions on Graphics, 21(3):576–581, July
With newer GPUs like the Radeon 9800 or GeForce FX we
2002. 1, 2
will be able to increase rendering speed by saving render
passes. The rendering quality will benefit from this aspect, 5. Henrik Wann Jensen and Per H. Christensen. Efficient
too: intermediate results need no longer be accumulated in simulation of light transport in scenes with participating
the precision limited frame buffer, thus the calculation gets media using photon maps. In Proceedings of SIG-
more accurate, due to higher internal precision of the GPUs. GRAPH 98, Computer Graphics Proceedings, Annual
With the Radeon 9700 we need 7 render passes for the local Conference Series, pages 311–320, July 1998. 1
and 7 for the global response.
6. Henrik Wann Jensen, Stephen R. Marschner, Marc
Fig. 7 shows the bunny model under different lighting Levoy, and Pat Hanrahan. A practical model for sub-
conditions. Fig. 8 and 9 show models with varying mate- surface light transport. In Proceedings of ACM SIG-
rial density. In our examples we used the material properties GRAPH 2001, Computer Graphics Proceedings, An-
given in Jensen6 . nual Conference Series, pages 511–518, August 2001.
1, 2, 5
References
1. Philippe Blasi, Bertrand LeSaẽc, and Christophe
Schlick. An importance driven monte-carlo solution to
the global illumination problem. In Fifth Eurographics
Workshop on Rendering, pages 173–183, June 1994. 1
2. Cass Everitt. Order-independent transparency.
http://developer.nvidia.com/view.asp?IO=order_
independent_transparency, 2001. 5
3. Pat Hanrahan and Wolfgang Krueger. Reflection from
layered surfaces due to subsurface scattering. In Pro-
ceedings of SIGGRAPH 93, Computer Graphics Pro-
201
Dachsbacher et al / Translucent Shadow Maps
Figure 6: The sub-surface scattering is evaluated in two steps: the local response and the global response (displayed brightened
in the lower left image).
Figure 7: The bunny model rendered with sub-surface scattering illuminated by a rotating parallel light source.
Figure 8: This model is illuminated by parallel light from the left. From left to right the material density increases.
Figure 9: The Max Planck model is back-lit with varying material density.
311