Jump to content

  • Log In with Google      Sign In   
  • Create Account


Question about code in "Stupid Spherical Harmonics (SH) Tricks"


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 B_old   Members   -  Reputation: 642

Like
0Likes
Like

Posted 15 January 2014 - 09:16 AM

The Stupid Spherical Harmonics (SH) Tricks article contains several code snippets and one is about irradiance environment maps.

 

The code is split in a CPU and a GPU part. And I am a bit confused about what happens where. 

I interpret it the way, that the SH coefficients are pre-processed before placing them in shader constants so that the code on the GPU can be somewhat simpler. Is that correct?

 

AFAIK you can interpolate two sets of SH coefficients to get a blended result. Is this still possible with the "processed" SH that are used by this shader code? Or would the interpolation have to be done beforehand?

 

Microsoft provides a small API that can project a cube map into spherical harmonics. I found the code really helpful but unfortunately I couldn't find any concise information about how to "sample" the SH coefficients with a direction vector. 



Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS