Advertisement Jump to content
Sign in to follow this  


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

Skiz0 Member since: 6/27/2005 Posted - 7/7/2008 9:00:44 PM I have been working with Spherical Harmonic / Irradiance for more than a week now, and some help would be highly appreciated! What I am trying to do is to generate the matrix M to represent an Irradiance environment maps ( To generate the 9 coefficients per channel (using order 2), I generate a cube map and compute the SH coefs using D3DXSHProjectCubeMap. For debugging purpose, I set +X face to red and all the other ones to black. D3DXSHProjectCubeMap returns these 9 coefs for the red channel: 0.590712f, -0.000000f, 0.000000f, -0.850431f, 0.000000f, 0.000000f, -0.364121f, 0.000000f, 0.630666f What should the matrix look like? I tried this one c1L22 c1L2−2 c1L21 c2L11 c1L2−2 −c1L22 c1L2−1 c2L1−1 c1L21 c1L2−1 c3L20 c2L10 c2L11 c2L1−1 c2L10 c4L00−c5L20 from: , with constants: c1 = 0.429043; c2 = 0.511664; c3 = 0.743125; c4 = 0.886227; c5 = 0.247708; but doesn't seem to work. If I try with normal (-1, 0, 0), the value should be 0 (as -X face is black) but I still get a value higher than 0 (0.7 something) Any help on what the matrix should look like working with value output from D3DXSHProjectCubeMap would be highly appreciated! Thanks.

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!