talk - Peter

advertisement
Local, Deformable Precomputed
Radiance Transfer
Peter-Pike Sloan, Ben Luna
Microsoft Corporation
John Snyder
Microsoft Research
“Local” Global Illumination
Renders GI effects on
local details
Rotates transfer model
Neglects gross shadowing
“Local” Global Illumination
Original
Ray Traced
Rotated
Bat Demo
Precomputed Radiance
Transfer (PRT)
illuminate
response
Transfer
Vector
Related Work: Area Lighting
[Ramamoorthi2001]
[Sloan2003]
[Muller2004]
[Kautz2004]
[Ng2003]
[Sloan2002]
[James2003]
[Liu2004;Wang2004]
[Zhou2005]
Other Related Work
• Directional Lighting
– [Malzbender2001],[Ashikhmin2002]
– [Heidrich2000]
– [Max1988],[Dana1999]
• Ambient Occlusion
– [Miller1994],[Phar2004]
– [Kontkanen2005],[Bunnel2005]
• Environmental Lighting
– [McCallister2002]
Spherical Harmonics (SH)
• Spherical Analog to the Fourier basis
• Used extensively in graphics
– [Kajiya84;Cabral87;Sillion91;Westin92;Stam95]
• Polynomials in R3 restricted to sphere
f lm 
 f  s  y  s  ds
lm
projection
f s 
n 1
l

f lm y lm  s 
l0 m l
reconstruction
Spherical Harmonics (SH)
• Spherical Analog to the Fourier basis
• Used extensively in graphics
– [Kajiya84;Cabral87;Sillion91;Westin92;Stam95]
• Polynomials in R3 restricted to sphere
f lm 
 f  s  y  s  ds
f s  f y s
projection
reconstruction
lm
Low Frequency Lighting
order 1
order 2
order 4
order 8
order 16
order 32
original
SH Rotational Invariance
rotate
SH
SH
rotate
Spherical Harmonics (SH)
nth order, n2 coefficients
Evaluation O(n2)
Zonal Harmonics (ZH)
Polynomials in Z
Circular Symmetry
SH Rotation Structure
C













L
L
L
L
L
L
L
L
L
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
1




Y




Z


X



Q   YX


Q   YZ

2
Q   3Z  1 


Q   XZ 
2 
 2
Q X Y 
O(n3)
Too
Slow!
ZH Rotation Structure
C













L
L
L
L
L
L
L
L
L
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
Q
 1





 Z






Q 


Q 

2
Q   3 Z  1


Q 



Q 

O(n2)
What’s that column?
z
Rotate delta function  so that z → z’ :
• Evaluate delta function at z = (0,0,1)
dl 

z
( s ) y l 0  s  ds  y l 0  z  
 z (s)
2l  1
4
z’
• Rotating scales column C by dl
– Equals y(z’) due to rotation invariance
C lm d l  y lm  z  
 z ( s )
What’s that column?
z
Rotate delta function  so that z → z’ :
• Evaluate delta function at z = (0,0,1)
dl 

z
( s ) y l 0  s  ds  y l 0  z  
 z (s)
2l  1
4
z’
• Rotating scales column C by dl
– Equals y(z’) due to rotation invariance
C lm d l  y lm  z  
 C lm  y lm  z   d l
 z ( s )
Efficient ZH Rotation
z
g(s)
Efficient ZH Rotation
z
g(s)
gl 
 3 4 


0


 0 



3
2


3 4 


 3 
 y s g sds
l0
Efficient ZH Rotation
z
g(s)
gl 
 3 4 


0


 0 



3
2


3 4 


 3 
 y s g sds
l0
z’
g’(s)
Efficient ZH Rotation
z
g(s)
 3 4 


0


 0 



3
2


3 4 


 3 
z’
g’(s)
g  G
gl 

yl 0  s  g  s  d s
*
y  z
*
*
*
*
*
G  diag  g 0 , g 1 , g 1 , g 1 ,


Efficient ZH Rotation
z
g(s)
 3 4 


0


 0 



3
2


3 4 


 3 
z’
g’(s)
g  G
gl 

yl 0  s  g  s  d s
*
y  z
*
*
*
*
*
G  diag  g 0 , g 1 , g 1 , g 1 ,
gl 
*
gl
dl
 gl
4
2l  1


Transfer Approx. Using ZH
• Approximate transfer vector t by sum of N “lobes”
N
t 

G i y  si
+
+
*
*

i 1
e.g .,
t 
+
Transfer Approx. Using ZH
• Approximate transfer vector t by sum of N “lobes”
N
t 

G i y  si
*
*

i 1
N
tR 

i 1
G i y  R si
*
*

Transfer Approx. Using ZH
• Approximate transfer vector t by sum of N “lobes”
N
t 

G i y  si
*
*

i 1
N
tR 

G i y  R si
*
*

i 1
• Minimize squared error over the sphere
 
 t  s   t  s 
S
2
2
ds  t  t
2
Single Lobe Solution
• For known direction s*, closed form solution
l


*
*
g l    y lm  s  t lm   4 (2 l  1) 
 m  1

• “Optimal linear” direction is often good
– Reproduces linear, formed by gradient of linear terms
– Well behaved under interpolation
– Cosine weighted direction of maximal visibility in AO
Multiple Lobes
Random vs. PRT Signals
1.00E+00
1.00E-01
Log Squared Error
1.00E-02
1.00E-03
1.00E-04
1.00E-05
1.00E-06
1.00E-07
1.00E-08
Random Max
Max
Random
Random Avg
Avg
Random
1.00E-09
Scene Max
1.00E-10
Scene Avg
0
1
2
3
4
Num ber of Lobes
5
6
7
Energy Distribution of
Transfer Signals
Energy Per Band
Energy
50%
45%
40%
Bump
35%
30%
WaffleSS
25%
20%
WeaveIR
Waffle
WeaveDirect
Swirls
15%
10%
Scene
Mayan
5%
0%
0
1
2
3
4
Band
5
6
7
Energy Distribution and
Subsurface Scatter
Effects of Subsurface
60%
50%
Energy
40%
30%
20%
Diffuse
10%
SSA
SSB
0%
0
1
2
3
4
Band
5
6
7
Rendering
• Rotate lobe axis, reconstruct transfer and dot
with lighting
 N

 i 1
n
l

y lm
l0 ml

R s  g  l

*
i
*
il
• Care must be taken when interpolating
– Non-linear parameters
– Lobe correspondence with multiple-lobes
Light Specialized Rendering
 N

 i 1
n
l

l0 ml
y lm

s  g  l

*
i
*
il
Light Specialized Rendering
 N

 i 1
N
n
l

l0 ml
n
l
 
i 1 l  0 m   l
y lm

s  g  l

*
i
*
il
y lm  s i  g il llm
*
*
Light Specialized Rendering
 N

 i 1
N
n
l

l0 ml
n
l
 
y lm

s  g  l

*
i
*
il
y lm  s i  g il llm
*
*
i 1 l  0 m   l
N
n

i 1 l  0
 l

*
g   y lm  s i  l lm 
 ml

*
il
Light Specialized Rendering
Light Specialized Rendering
N
n

i 1 l  0
Quadratic
Cubic
Quartic
Quintic
 l

*
g   y lm  s i  l lm 
 ml

*
il
O(N n2) → O(N n)
Generating LDPRT Models
• PRT simulation over mesh
– texture: specify patch (a)
– per-vertex: specify mesh (b)
• Parameterized models
– ad-hoc using intuitive parameters (c)
(a) LDPRT texture
– fit to simulation data (d)
(c) thin-membrane model
(d) wrinkle model
(b) LDPRT mesh
LDPRT Texture Pipeline
• Start with “tileable” heightmap
• Simulate 3x3 grid
• Extract and fit LDPRT
• Store in texture maps
Thin Membrane Model
• Single degree of freedom (DOF)
– “optical thickness”: light bleed in negative normal direction
Wrinkle Model
• Two DOF
– Phase, position along canonical wrinkle
Wrinkle Model
• Two DOF
– Phase, position along canonical wrinkle
– Amplitude, max magnitude of wrinkle
Wrinkle Model Fit
• Compute several simulations
– 64 discrete amplitudes
– 255 unique points in phase
• Fit 32x32 textures
– One optimization for all DOF simultaneously
– Optimized for bi-linear reconstruction
– 3 lobes
Glossy LDPRT
• Use separable BRDF
• Encode each “row” of
transfer matrix using
multiple lobes (3 lobes,
4th order lighting)
• See paper for details
Demo
Conclusions/Future Work
• “local” global illumination effects
– soft shadows, inter-reflections, translucency
• easy-to-rotate rep. for spherical functions
– sums of rotated zonal harmonics
– allows dynamic geometry, real-time performance
– may be useful in other applications [Zhou2005]
• future work: non-local effects
– articulated characters
Acknowledgements
• Demos/Art: John Steed, Shanon Drone,
Jason Sandlin
• Video: David Thiel
• Graphics Cards: Matt Radeki
• Light Probes: Paul Debevec
Download