IIRC, Peter went over the derivation on this mailing list.  Might be worth a troll through the archives.

 

Also, FWIW (realizing that Peter will likely groan with disgust) for Warhawk I simply did a standard SH lookup per basis vector (spun into world-space) in my vertex shader.  I used this as a way to mix my ambient volume lighting and point lights for a constant per-pixel (HL2 lookup) cost.

 

---bruce

 


From: gdalgorithms-list-bounces@lists.sourceforge.net [mailto:gdalgorithms-list-bounces@lists.sourceforge.net] On Behalf Of Rowan Wyborn (2K Australia)
Sent: Tuesday, May 20, 2008 1:04 AM
To: gdalgorithms-list@lists.sourceforge.net
Subject: [Algorithms] Projecting SH into the Half life 2 basis

 

Howdy,

 

The paper “Normal Mapping for Precomputed Radiance Transfer” (http://www.ppsloan.org/publications/) contains a handy matrix to project 3rd order SH into the half life 2 basis. I was just wondering if anyone (or P.P.S if he’s still on this list J) had any insights into how this matrix is derived?

 

Additionally I wonder whether its possible to generalize this solution to an arbitrarily oriented set of basis vectors? Its not clear to me whether the results in this paper for the HL2 basis are achieved by:

a)      rotating the SH lighting into each vertex’s basis orientation and projecting using the given matrix

or

b)       by generating the projection matrix on the fly for each vertex’s basis orientation.

 

Anyone got any ideas?

 

Thanks,

Rowan