Sign in to follow this  
Skiz0

SH/Irradiance/D3DXSHProjectCubeMap problem

Recommended Posts

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 (http:www.csie.ntu.edu.tw/~cyy/courses/rendering/07fall/lectures/handouts/lec15_SH.ppt) 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: http://www.cs.columbia.edu/cg/pdfs/60_envmap.pdf , 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. [Edited by - Skiz0 on July 7, 2008 8:56:14 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this