# understanding spherical harmonics

This topic is 4322 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I've been doing some reading in the last weeks to understand spherical harmonic lighting; but I've found it somewhat difficult to grasp. I've read the Green paper (among others) and it's not a *complete* mystery anymore; but there are many remaining issues and I want to rule out wrong assumptions I might have, preventing me from fully understand this. I don't know about Fourier transformations, but I remember Taylor series from school (at least a bit). As I understood it, spherical harmonics present a way to approximate a spherical function by another one. So these nice illumination integrals need to be reduced to a straightforward spherical function? So could I project any function f(theta, phi) to a spherical harmonic? What would I get for this? Can I pre-calculate the function for one mesh and with this 'coefficients' I will get more or less what the results from the original function would be at that point? But what when the object or the light-source is moving? Is is just a matter of precalculation if the scene is light by a separate, discrete light source or by IBL? I'm also not seeing through this data structure yet, how these bands are organized and correlating with the coefficients? Or does maybe someone knows a tools where it's possible to play with interactive visualizations of spherical harmonic functions & different approximations/simple examples? My goal is to understand how spherical harmonic lighting could be used to simulate subsurface scattering like in the DirectX SDK Bat-Demo. Any help would be really great! Thank you very much.

##### Share on other sites
try the following pdf (written by a good friend of mine ;)
http://heim.c-otto.de/~volker/prosem_paper.pdf

##### Share on other sites
Quote:
 Original post by hbuelI don't know about Fourier transformations, but I remember Taylor series from school (at least a bit). As I understood it, spherical harmonics present a way to approximate a spherical function by another one.

The "another one" is the sum of a series of well-defined 'basis' functions. It's similar to the way in which you can approximate any wave by summing sines and cosines (the fact that it's called spherical harmonics is no accident).

Quote:
 So these nice illumination integrals need to be reduced to a straightforward spherical function?
They get decomposed into their most significant, low-frequency terms.

Quote:
 So could I project any function f(theta, phi) to a spherical harmonic?
Yep. You'd need an infinite number of terms in order to accurately capture any function, though. The fewer terms you use, the less accurate your representation (though the smaller it gets).

A Spherical Harmonic is basically just a way of compressing a spherical function in a fairly convenient way. It's not specific to lighting; it's just that it can compress ambient lighting samples quite effectively because they're fairly low-frequency. It's not much good for things like sharp shadows.

Quote:
 My goal is to understand how spherical harmonic lighting could be used to simulate subsurface scattering like in the DirectX SDK Bat-Demo.
Ah, careful. That's Precomputed Radiance Transfer. If I remember correctly, it stores lighting samples as spherical harmonics for ease of use, but the SHes themselves don't provide the subsurface scattering effect.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
633710
• Total Posts
3013486
×