Fast, Arbitrary BRDF Shading for Low-Frequency Lighting Using Spherical Harmonics

Preview:

DESCRIPTION

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. BRDF Complexity. - PowerPoint PPT Presentation

Citation preview

Fast, Arbitrary BRDF Shading for Fast, Arbitrary BRDF Shading for Low-Frequency Lighting Using Low-Frequency Lighting Using

Spherical HarmonicsSpherical Harmonics

Jan Kautz, MPI InformatikJan Kautz, MPI Informatik

Peter-Pike Sloan, Microsoft ResearchPeter-Pike Sloan, Microsoft Research

John Snyder, Microsoft ResearchJohn Snyder, Microsoft Research

Motivation –Motivation –BRDF vs. Light ComplexityBRDF vs. Light Complexity

BRDF BRDF ComplexityComplexity

LightingLighting

Phong +Phong +diffusediffuse

arbitraryarbitraryaniso. BRDFsaniso. BRDFs

pointpointlightslights

areaarealightslights ??

Motivation – Motivation – What we wantWhat we want

• What we want:What we want:• Illuminate objects with Illuminate objects with

environment mapsenvironment maps

• Use Use arbitraryarbitrary BRDFs BRDFs

• Change lighting Change lighting on-the-flyon-the-fly

• Possibly include Possibly include self-shadowing andself-shadowing andinterreflectionsinterreflections

• At real-time ratesAt real-time rates

Ph

on

gP

hon

gA

nis

otro

pic

An

isotro

pic

Related Work –Related Work –Interactive TechniquesInteractive Techniques

BRDF BRDF ComplexityComplexity

LightingLighting

PhoDiffPhoDiff

RefSpaceRefSpace

ApproxEnvApproxEnv HomEnvHomEnv

DiffSHDiffSH

FreqSpace FreqSpace

Our TechniqueOur Technique

ArbBRDFArbBRDF

PRTPRT

diffusediffuse PhongPhong isotropicisotropic anisotropicanisotropic

Phong/Diffuse Prefiltered Environment MapsPhong/Diffuse Prefiltered Environment Maps[Miller84] [Greene86] [Heidrich99][Miller84] [Greene86] [Heidrich99]Arbitrary BRDFs with Point LightsArbitrary BRDFs with Point Lights[Kautz99] [McCool01][Kautz99] [McCool01]BRDF Approximation for Environment MapsBRDF Approximation for Environment Maps[Kautz99][Kautz99]Reflection Space RenderingReflection Space Rendering[Cabral99][Cabral99]Diffuse Environment Maps using Spherical HarmonicsDiffuse Environment Maps using Spherical Harmonics[Ramamoorthi01][Ramamoorthi01]Homomorphic Factorization of Environment MapsHomomorphic Factorization of Environment Maps[Latta02][Latta02]Frequency Space Environment MappingFrequency Space Environment Mapping[Ramamoorthi02][Ramamoorthi02]Precomputed Radiance TransferPrecomputed Radiance Transfer[Sloan02][Sloan02]Our TechniqueOur Technique

point lightspoint lights

low-frequencylow-frequencyarea lightingarea lighting

high-frequencyhigh-frequencyarea lightingarea lighting

Related WorkRelated Work

• Previous use of Spherical HarmonicsPrevious use of Spherical Harmonics• [Cabral87] Bidirectional Reflection Functions [Cabral87] Bidirectional Reflection Functions

from Surface Bump Mapsfrom Surface Bump Maps

• [Westin92] Predicting Reflectance Functions [Westin92] Predicting Reflectance Functions from Complex Surfaces from Complex Surfaces

Background – Background – Spherical HarmonicsSpherical Harmonics

• Spherical Harmonics : Spherical Harmonics : • Orthonormal basis over the sphereOrthonormal basis over the sphere

• Analogous to Fourier transform over 1D circleAnalogous to Fourier transform over 1D circle

• Important properties:Important properties:• Rotational invariance Rotational invariance no aliasing artifacts no aliasing artifacts

• Projection:Projection:

• Integration:Integration:

• Rotation: linear xform on coefficientsRotation: linear xform on coefficients

sdsysff ii

)()( sdsysff ii

)()(

n

iiibasdsbsa

1

)(~)(~

n

iiibasdsbsa

1

)(~)(~

)(syi)(syi

Background –Background –Spherical HarmonicsSpherical Harmonics

• Basis functions (examples)Basis functions (examples)

i = 1i = 1 i = 2i = 2 i = 3i = 3 i = 4i = 4

i = 8i = 8 i = 12i = 12 i = 15i = 15 i = 19i = 19

Background –Background –Spherical HarmonicsSpherical Harmonics

• Example: projection of environmentExample: projection of environment

n=4n=4 n=9n=9 n=25n=25

n=26n=2622 originaloriginal

sdsfsLvL vinout

p

)()()( * sdsfsLvL v

inoutp

)()()( *

Environment Mapping + Environment Mapping + Spherical HarmonicsSpherical Harmonics

• Rendering Equation (no shadows):Rendering Equation (no shadows):

• Rewrite with Rewrite with

• Project Lighting and BRDFProject Lighting and BRDF

sdnsvsfsLvL pinout

p

)0,max(),()()( sdnsvsfsLvL p

inoutp

)0,max(),()()(

)0,max(),()(* pv nsvsfsf

)0,max(),()(* pv nsvsfsf

light function:light function:

into SHinto SH

BRDF:BRDF:

into SHinto SH

*,ivf *,ivf

iniLiniL

Evaluating the IntegralEvaluating the Integral

• The integralThe integral

becomesbecomes

• But BRDF defined in local frameBut BRDF defined in local frameRotate lighting (or BRDF) to match:Rotate lighting (or BRDF) to match:

sdsfsLvL vinout

p

)()()( * sdsfsLvL v

inoutp

)()()( *

n

iiv

ini

outp fLvL *

,)(

n

iiv

ini

outp fLvL *

,)(

n

iiv

inip

outp fLRvL *

,)(

n

iiv

inip

outp fLRvL *

,)(

pRpR

Preprocessing –Preprocessing –BRDF TextureBRDF Texture

• Project BRDF into SH:Project BRDF into SH:

• Put coefficients in texture mapPut coefficients in texture map

• Use parabolic parameterization for Use parabolic parameterization for

sdsysff iviv

)()(**

, sdsysff iviv

)()(**

,

vv

i=1i=1 i=3i=3 i=4i=4 i=5i=5 i=6i=6 i=7i=7

……

)1,0,0(v

)1,0,0(v

)0,1,0(v

)0,1,0(v

RenderingRendering

Project lightingProject lighting

……

Lookup (local )Lookup (local )*,ivf *,ivf v

v

* * = =

Rotate lighting (to local)Rotate lighting (to local)

= =

Compute integralCompute integral

sdsfsLvL vinout

p

)()()( * sdsfsLvL v

inoutp

)()()( *

per per objectobject

per per pixel/vertexpixel/vertex

ExamplesExamples

PhongPhong AnisotropicAnisotropicbrushed in Xbrushed in X

AnisotropicAnisotropicbrushed in Ybrushed in Y

Rendering – Rendering – Fixed LightFixed Light

……

* * = =

= =

Project lightingProject lighting Lookup (local )Lookup (local )*,ivf *,ivf v

v

Rotate lighting (local)Rotate lighting (local)

Compute integralCompute integral

sdsfsLvL vinout

p

)()()( * sdsfsLvL v

inoutp

)()()( *

ONCEONCE

Rendering – Rendering – Fixed ViewFixed View

……

* * = =

= =

Project lightingProject lighting Lookup (local )Lookup (local )*,ivf *,ivf v

v

Rotate BRDF (to global)Rotate BRDF (to global)

Compute integralCompute integral

sdsfsLvL vinout

p

)()()( * sdsfsLvL v

inoutp

)()()( *

ONCEONCE

ExampleExample

• Bird modelBird model

• 48K vert.48K vert.

• Measured VinylMeasured Vinyl

• FPS:FPS:• 6.04 free light/view6.04 free light/view

• 28.4 fixed light28.4 fixed light

• 128 fixed view128 fixed view

Precomputed Radiance Precomputed Radiance TransferTransfer

Without PRTWithout PRT PRT: Shadows+Interrefl.PRT: Shadows+Interrefl.SIG02: Phong onlySIG02: Phong only

[SIG02][SIG02]

Precomputed Radiance Precomputed Radiance Transfer – Transfer MatrixTransfer – Transfer Matrix

**

**

lig

hti

ng

lig

hti

ng

transfer matricestransfer matrices transferred radiancetransferred radiance

pp11

pp22

pp11

pp22

Precompute how global incident lighting Precompute how global incident lighting local incident local incident

Arbitrary BRDF with PRTArbitrary BRDF with PRT

……

* * = =

= =

Project lightingProject lighting Lookup (local )Lookup (local )*,ivf *,ivf v

v

Transfer & rotate lightTransfer & rotate light

Compute integralCompute integral

sdsfsVsLvL vpinout

p

)()()()( * sdsfsVsLvL vp

inoutp

)()()()( *

per per objectobject

per per pixel/vertexpixel/vertex* *

ExampleExample

• StanfordStanfordbuddhabuddha

• 50K vert.50K vert.

• Ashikhmin-Ashikhmin-BRDFBRDF

• FPS:FPS:• 4.05 no xfer4.05 no xfer

• 3.22 xfer3.22 xfer

• 15.6 fixed light15.6 fixed light

• 127 fixed view127 fixed view

Example 2:Example 2:PRT with different BRDFsPRT with different BRDFs

Phong [SIG02]Phong [SIG02] Measured VinylMeasured Vinyl

Results –Results –Different BRDFsDifferent BRDFs

Results –Results –Brushed Metal-PatchBrushed Metal-Patch

Anisotropic ASAnisotropic ASbrushed radiallybrushed radially

Anisotropic ASAnisotropic ASbrushed tangentallybrushed tangentally

Results – Results – Spatially Varying BRDFSpatially Varying BRDF

Varying ExponentVarying Exponent Varying Varying AnisotropyAnisotropy

Comparison of SH order Comparison of SH order vs. Glossinessvs. Glossiness

ConclusionsConclusions

Pros:Pros:

• Fast, arbitrary dynamic lightingFast, arbitrary dynamic lighting

• Works for Works for arbitraryarbitrary BRDFs BRDFs

• Combined with PRT: includes Combined with PRT: includes shadows and interreflectionsshadows and interreflections

Cons:Cons:

• Works only for low-frequency Works only for low-frequency lightinglighting

• Not real-time (yet)Not real-time (yet)

Thank you!Thank you!

Questions?Questions?

Please visit us at Please visit us at www.mpi-sb.mpg.dewww.mpi-sb.mpg.de

Recommended