Professional Documents
Culture Documents
Actual Games
Tom Forsyth
Muckyfoot Productions Ltd
tomf@muckyfoot.com
The Basics
Looking up a direction in the cube-map
A set of N basis functions used by all SHs
Components of the direction being looked up
1, X, Y, Z, XY, YZ, ZX, X2-Y2, 1-3Z2,
Features of Harmonics
Smooth over the sphere
No seams or hot spots
Irradiance Concept
Ignore SH for now think of cubemaps
Representing incoming distant lights
Representing the diffuse cosine response
Cosine response = max(0,N.L), summed for all lights
Irradiance Concept
Irradiance Concept
Irradiance Concept
Using SH
Using SH Better
In Practice
Find brightest n lights (n=1 to 3 usually)
Shade those conventionally
Specular, bumpmapped, self-shadowing, etc
Gotchas
Only vertex diffuse lighting
No bumpmaps (PS2.0 shaders can!)
No specular, only diffuse
So do brightest 2 lights normally
Cool Stuff
Take (HDR) skybox, convert to SH offline
Add to all computed SHs
Perfect sunset lighting
Artists can tweak by drawing on bitmaps!
Presampled radiosity
Pick some sample points in environment
Render cubemaps at those points, convert to SH
At runtime, for any object, linearly interpolate between
nearest sample point SHs.
Gives lighting off walls, through doorways, etc
Demo
Compare many real lights to just 2
Too dark lights are discarded.
Questions
Conclusions
References
Ramamoorthi & Hanrahan
An Efficient Representation for Irradiance
Environment Maps
Peter-Pike Sloan
Siggraph 2002 & 2003 papers
Robin Green
Spherical Harmonic Lighting: The Gritty Details