Arbitrary BRDF Shading

Download Report

Transcript Arbitrary BRDF Shading

Fast, Arbitrary BRDF Shading for
Low-Frequency Lighting Using
Spherical Harmonics
Jan Kautz, MPI Informatik
Peter-Pike Sloan, Microsoft Research
John Snyder, Microsoft Research
Motivation –
BRDF vs. Light Complexity
Lighting
?
area
lights
point
lights
Phong +
diffuse
arbitrary
aniso. BRDFs
BRDF
Complexity
Motivation –
What we want
• What we want:
Anisotropic
environment maps
• Use arbitrary BRDFs
• Change lighting
on-the-fly
• Possibly include
self-shadowing and
interreflections
• At real-time rates
Phong
• Illuminate objects with
Related Work –
Interactive Techniques
Lighting
high-frequency
area lighting
DiffSH
RefSpace
PhoDiff
FreqSpace
ApproxEnv HomEnv
low-frequency
area lighting
Our Technique
PRT
ArbBRDF
point lights
diffuse
Phong
isotropic
BRDF
anisotropic Complexity
Our Technique
Phong/Diffuse
Arbitrary
BRDF
Reflection
Diffuse
Homomorphic
Frequency
Precomputed
Approximation
Environment
BRDFs
Space
Space
Radiance
Factorization
Prefiltered
with
Rendering
Environment
Maps
for
Point
Transfer
Environment
Environment
using
Lights
of Environment
Mapping
Spherical
Maps
Maps
Harmonics
Maps
[Miller84] [Greene86]
[Kautz99]
[Cabral99]
[Ramamoorthi01]
[Latta02]
[Ramamoorthi02]
[Sloan02]
[McCool01] [Heidrich99]
Related Work
• Previous use of Spherical Harmonics
• [Cabral87] Bidirectional Reflection Functions
from Surface Bump Maps
• [Westin92] Predicting Reflectance Functions
from Complex Surfaces
Background –
Spherical Harmonics

• Spherical Harmonics yi (s ) :
• Orthonormal basis over the sphere
• Analogous to Fourier transform over 1D
circle
• Important properties:
• Rotational invariance  no aliasing artifacts

 
• Projection: f i   f (s ) yi (s )d s

n

~


• Integration: a~( s )b ( s )d s   ai bi

i 1
• Rotation: linear xform on coefficients
Background –
Spherical Harmonics
• Basis functions (examples)
i=1
i=2
i=3
i=4
i=8
i = 12
i = 15
i = 19
Background –
Spherical Harmonics
• Example: projection of environment
n=4
n=9
n=262
original
n=25
Environment Mapping +
Spherical Harmonics
• Rendering Equation (no shadows):

 
 

in 
L (v )   L ( s ) f ( s , v ) max( s  n p ,0)d s
out
p

 
 
• Rewrite with f (s )  f (s , v ) max( s  n p ,0)
• Project Lighting and BRDF

out 
in 
* 
L p (v )   L ( s ) f v ( s )d s
*

v
into SH
into SH
in
light function: Li
BRDF: f *
v ,i
Evaluating the Integral
• The integral


in 
* 
L (v )   L ( s ) f v ( s )d s
out
p
n

out
in *
becomes L p (v )   Li f v ,i
i
• But BRDF defined in local frame R p
Rotate lighting (or BRDF) to match:
 
n

out
in
*

L p (v )   R p Li f v ,i
i
Preprocessing –
BRDF Texture
• Project BRDF into SH:
f
*

v ,i

 
  f ( s ) yi ( s )d s
*

v
• Put coefficients in texture map

• Use parabolic parameterization for v
…
i=1
i=3

v  (0,0,1)
i=4
i=5
i=6

v  (0,1,0)
i=7
Rendering
Project lighting
Lookup
f
*
 (local
v ,i

v)
per
object
…
Rotate lighting (to local)
per
pixel/vertex
* =
Compute integral

=


in 
* 
 ( s )d s
Lout
(
v
)

L
(
s
)
f
p
v

Examples
Phong
Anisotropic
brushed in X
Anisotropic
brushed in Y
Rendering –
Fixed Light
Project lighting
Lookup

v)
…
ONCE
Rotate lighting (local)
* =
Compute integral

f
*
 (local
v ,i
=


in 
* 
 ( s )d s
Lout
(
v
)

L
(
s
)
f
p
v

Rendering –
Fixed View
Project lighting
Lookup
f
*
 (local
v ,i

v)
…
Rotate BRDF (to global)
* =
Compute integral

=


in 
* 
 ( s )d s
Lout
(
v
)

L
(
s
)
f
p
v

ONCE
Example
• Bird model
• 48K vert.
• Measured Vinyl
• FPS:
• 6.04 free light/view
• 28.4 fixed light
• 128 fixed view
Precomputed Radiance
Transfer
[SIG02]
Without PRT
PRT: Shadows+Interrefl.
SIG02: Phong only
Precomputed Radiance
Transfer – Transfer Matrix
Precompute how global incident lighting  local incident
*
p1
lighting
p1
p2
p2
*
transfer matrices
transferred radiance
Arbitrary BRDF with PRT
Project lighting
Lookup
f
*
 (local
v ,i

v)
per
object
…
Transfer & rotate light
*
per
pixel/vertex
* =
Compute integral

=

 *  
in 
Lout
(
v
)

L
(
s
)
V
(
s
) f v ( s )d s
p
p

Example
• Stanford
buddha
• 50K vert.
• AshikhminBRDF
• FPS:
• 4.05 no xfer
• 3.22 xfer
• 15.6 fixed light
• 127 fixed view
Example 2:
PRT with different BRDFs
Phong [SIG02]
Measured Vinyl
Results –
Different BRDFs
Results –
Brushed Metal-Patch
Anisotropic AS
brushed radially
Anisotropic AS
brushed tangentally
Results –
Spatially Varying BRDF
Varying Exponent
Varying Anisotropy
Comparison of SH order
vs. Glossiness
Conclusions
Pros:
• Fast, arbitrary dynamic lighting
• Works for arbitrary BRDFs
• Combined with PRT: includes
shadows and interreflections
Cons:
• Works only for low-frequency
lighting
• Not real-time (yet)
Thank you!
Questions?
Please visit us at www.mpi-sb.mpg.de