Jump to content
  • Advertisement
Sign in to follow this  
mazahist

The use of spherical harmonics

This topic is 849 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

Advertisement

The array of spherical harmonic coefficients (that you now presumably have) can be thought of as a discrete cosine transform results of the lighting signal, where the spatial parameter space is a sphere.

 

To reconstruct the approximation of the signal (the light strength), you basically sum the cosines of the coefficients together, using the frequency multipliers and weights that you used to calculate the coefficients. This integration operation closely resembles the process with which you obtain said coefficients. The forward and inverse operations on SH:s are extremely similar to those in DCT and FFT, for example.

 

Note that you should have three sets of sh coefficients; one for each channel in RGB. The summation is relatively simple if you perform the sh calculation on the RGB signal so that you get an array of float3's (for RGB triplets) as a result; this is because in HLSL or GLSL, you can directly obtain both the cosine and the sum of 1 to 4-element vector primitives.

Edited by Nik02

Share this post


Link to post
Share on other sites

The question is somewhat vague. What was the intent of computing the SH in the first place ( yeah I know another question ) ?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!