Jump to content
  • Advertisement
Sign in to follow this  
hbuel

understanding spherical harmonics

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by hbuel
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.


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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!