Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMJP

Posted 18 November 2012 - 05:45 PM

Hey ginkgo! Well, yes - but isn't that exactly the idea behind spherical harmonics - approximating a function using a polynomial of a finite degree (e.g. degree 2 already gives an error rate less than 1%).


Yes, you generally use spherical harmonics as a means of approximating some function defined about a sphere using a compact set of coefficients. The issue that ginkgo was alluding to has to do with the fact that spherical harmonics are essentially a frequency-space representation of a function, where lower coefficients correspond lower-frequency components of the function and the higher coefficients correspond to higher-frequency components. With your typical "punctual" light source (point light, directional light, etc.) the incoming radiance in terms of a sphere surrounding some point in space (such as the surface you're rendering) is essentially a dirac delta function. A delta function would require infinite coefficients to be represented in spherical harmonics, so it's basically impossible. You can get the best approximation for some SH order by directly projecting the direction of the delta onto the basis functions (which is mentioned in Stupid SH tricks), but if you were to display the results for 2nd-order SH you'd find that you basically end up with a big low-frequency blob oriented about the direction. This is why "area" lights that have some volume associated with them work better with SH, since they can be represented better with less coefficients. The same goes for any function defined about a sphere, for instance a BRDF or an NDF.

#1MJP

Posted 18 November 2012 - 04:35 PM

Hey ginkgo! Well, yes - but isn't that exactly the idea behind spherical harmonics - approximating a function using a polynomial of a finite degree (e.g. degree 2 already gives an error rate less than 1%).


Yes, you generally use spherical harmonics as a means of approximating some function defined about a sphere using a compact set of coefficients. The issue that ginkgo was alluding to has to do with the fact that spherical harmonics are essentially a frequency-space representation of a function, where lower coefficients correspond lower-frequency components of the function and the higher coefficients correspond to higher-frequency components. With your typical "punctual" light source (point light, directional light, etc.) the incoming radiance in terms of a sphere surrounding some point in space (such as the surface you're rendering) is essentially a dirac delta function. A delta function would require infinite coefficients to be represented in spherical harmonics, so it's basically impossible. You can get the best approximation for some SH order by directly projecting the direction of the delta onto the basis functions (which is mentioned in Stupid SH tricks), but if you were to display the results for 2nd-order SH you'd find that you basically end up with a big low-frequency blob oriented about the direction. This is why "area" lights that have some volume associated with them work better with SH, since they can be represented better with less coefficients. The same goes for any low-frequency function, for instance a BRDF or an NDF.

PARTNERS