Title: Real-time Soft Shadows in Dynamic Scenes using Spherical Harmonic Exponentiation
1Real-time Soft Shadows in Dynamic Scenes using
Spherical Harmonic Exponentiation
- Zhong Ren1 Rui Wang1 John Snyder2 Kun Zhou3
Xinguo Liu3 - Bo Sun4 Peter-Pike Sloan5 Hujun Bao1 Qunsheng
Peng1 Baining Guo3 - 1 Zhejiang Univ. 2 Microsoft Research 3
Microsoft Research Asia - 4 Columbia Univ. 5 Microsoft Corporation
2Fast Soft Shadows in Dynamic Scenes
- Motivation
- realism
- shape/proximity cues
- new look
- Challenges
- large light sources
- complex, dynamic blockers/receivers
- self-shadows cast-shadows
unshadowed
shadowed
3Previous Work in Fast Shadow Rendering
Name Reference Lighting Constraints
shadow buffer/vol. Williams78, point -
accum. buffer Segal92, small area many passes
PRT (SH) Sloan02, low-freq static
PRT (all-freq) Ng03, all-freq static, diffuse
PRT (dynamic) James03,05 low-freq precomp. sequences
LDPRT Sloan05 low-freq local effects
ambient occlusion Bunnel04, DC no casting
shadow fields Zhou05 low-freq few, rigid objs
SHEXP current low-freq many, deform objs
4Previous Work in Fast Shadow Rendering
Name Reference Lighting Constraints
ambient occlusion Bunnel04, DC no casting
shadow fields Zhou05 low-freq few, rigid objs
SHEXP current low-freq many, deform objs
- soft shadows from large-area lights
- dynamic shading
- blocker/receiver motion not precomputed
5Ambient Occlusion vs. SHEXP
ray traced
6SHEXP Summary
- Approximate blockers with spheres
- accumulate over large blockers, not light
directions - symmetry simplifies calculation
7SHEXP Summary
- Approximate blockers with spheres
- accumulate over large blockers, not light
directions - symmetry simplifies calculation
- Represent low-frequency visibility/lighting in SH
8SHEXP Summary
- Approximate blockers with spheres
- accumulate over large blockers, not light
directions - symmetry simplifies calculation
- Represent low-frequency visibility/lighting in SH
- For each receiver point p
- accumulate visibility logarithm over blocker
spheres - exponentiate
- shade
9SH ReviewProjection and Reconstruction
s
10SH ReviewProjection and Reconstruction
11SH ReviewProjection and Reconstruction
12SH ReviewProducts
13SH ReviewProducts
14SH ReviewProducts
15SH ReviewShading Ng04
gp
L
H(Np)
lighting
visibility
BRDF
16SH ReviewShading Ng04
gp
L
H(Np)
17Visibility Accumulation (Product Space Zhou05)
g g1g2gm
- m moving blockers
- gi is SH visibility of blocker i
- exact product order m(n-1)1
- truncate to order n after each
- need m-1 expensive SH products
18Visibility Accumulation Example(Product Space)
Product Space Accumulated
64 Spheres
1 Spheres
2 Spheres
3 Spheres
16 Spheres
32 Spheres
19Idea Use Log Space
- SH product expensive O(n5)
- SH add cheap O(n2)
- e.g. SH order n4
- ab ? 673 flops
- ab ? 16 adds!
- suggests rule for positive reals
20Visibility Accumulation(Log Space)
g exp(f 1 f 2 f m)
- applies scalar rule to every visibility direction
- f ilog(gi) is SH log visibility of sphere i
- need m-1 vector adds, one exp
- greatly reduces per-blocker cost ( ? )
21Visibility Accumulation Example(Log Space)
Log Space Accumulated
64 Spheres
1 Spheres
2 Spheres
3 Spheres
16 Spheres
32 Spheres
22Log vs. Product Space
SH Projection
Visibility Function
Log Space Approx.
Product Space Approx.
23SH Exponential Volterra Series
- expand exp(x) in SH projection formula
24SH Exponential Volterra Series
- expand exp(x) in SH projection formula
- yielding sum of powers f p
25SH Exponential Product Series
- exact evaluation horribly expensive!
- order-p tensors
- output order grows with p p(n-1)1
- approximate with product series
- degree p series needs p-1 SH products
- truncate each product back to order n
26Accelerating Product Series
- bigger f ? more series terms in exp( f )
- DC isolation compute DC via scalar exp
- scaling/squaring divide by 2p, exp, square p
times - factoring reduce products Higham05
27Optimal Linear Approximation
- linear model (degree 1 series)
- no SH products!
- optimal coefs a and b
- tabulated functions of input magnitude f
- least-squares fit to example visibility functions
- accurate for n 4, f 4.8
- extend magnitude range using scaling/squaring
28SHEXP Method Comparison
log space (SHEXP)
PS-2, 45k
PS-21, 328k
product space, 495k
HYB, 31k
OL, 0
29SHEXP Method Comparison
log space (SHEXP)
PS-2, 45k
PS-21, 328k
product space, 495k
- evaluate on GPU
- workhorse method
HYB, 31k
OL, 0
30SH Logarithm
- computed for sphere blockers as preprocess
- naïve method numerical integration with clipping
- better method series inversion
31Part 2 Rendering System Results
32Approximating Blocker Geometry
- bounding sphere set
- minimize outside volume Wang06
- animate via mean value coordinates Ju05
33Single Sphere Visibility
- tabulate logs of circle visibility, f (q)
- function of angle subtended, q
- canonically oriented around z axis
- rotate on-the-fly
34Single Sphere Visibility(Rotation)
- use rotation rule Sloan05
35Self-Shadowing Replacement Rules
Tp
p
36Sphere Hierarchies
Blocker Hierarchy
37Sphere Hierarchies
38Sphere Hierarchies
39Sphere Hierarchies
40Per-Band Weighting
41Rendering
- Per-cluster computation (on CPU)
- Per-vertex computation (on GPU)
42Per-Cluster Computation (CPU)
- For each cluster
- choose cut
- for each sphere in cut
- compute weight vector
- Pack information into textures
- sphere cut info (center, radius, weight vector)
- vertex info (position, normal, receiver cluster
id)
43Per-Vertex Computation (GPU)
- For each sphere i in cut
- apply self-shadow replacement rules
- get canonical log visibility vector f (q)
- rotate and apply weights, yielding f i
- accumulate f f i
- Exponentiate using HYB
- total visibility vector g exp( f )
- Shade using (H(N), L, g)
44Demos
45Contributions
- Blocker approximation using bounding sphere sets
- general, deformable objects
- Accumulation of low-frequency blocker visibility
- much faster in log space
- accurate as product space
- Fast evaluation of SH exp/log
- product series approx. to Volterra series
- optimal linear method
- SH log by series inversion
46Limitations
- Low-frequency lighting
- Low-frequency (diffuse) BRDF
- Distant lighting
- true local lighting requires sorting
- demo special case
47Future Work
- Anisotropic blocker models
- Diffuse inter-reflection
- Models for spatial, temporal variation
48Acknowledgements
- Becky Sundling
- video production
- Mingdong Xie
- modeling and animation
- Anon. SIGGRAPH reviewers
- suggestions and comments
and thank you!
49Comparison Log vs. Product Spacen4
SH Projection
Visibility Function
Log Space Approx.
Product Space Approx.
50Comparison Log vs. Product Spacen4,
accumulation at n6
SH Projection
Visibility Function
Log Space Approx.
Product Space Approx.