Re: [Algorithms] Some question about "Lighting andMaterialofHalo3"and "Lightmap compression in Halo
Brought to you by:
vexxed72
From: Sam M. <sam...@ge...> - 2010-02-01 21:26:17
|
Hi Sébastien, Yeah, the maths is a bit of a headache... I think I see where you might be getting stuck. The clamped cosine, projected into SH, is a radially symmetric SH (ie. a zonal harmonic with no rotation). But the fact it is radially symmetric is a requirement if the convolution to produce another SH as an output. Convolving two arbitrary SH functions together doesn't actually produce another SH - it produces a higher dimensional object, which isn't so useful. It's only when one (or both) of the SH are radially symmetric that the result is still an SH. And by a similar argument, both SH need to be radially symmetric to get a radially symmetric output (in general). Convolution with a clamped cosine has some additional properties though. The 'clamp' part of the function produces a lot* of high frequency harmonics, but only even-numbered ones - all the odd-numbered levels vanish apart from L1. The coefficients also tail off very quickly so you don't need to store anything beyond L2 in practice (L3 is 0 anyway). The very best way to test this is to completely ignore the maths, and show people screenshots with different versions. You can see there is a difference, but it's extremely hard to tell which one is the mathematically more accurate version. They all look good, just different. Completely separate to that, you can sometimes represent a non-radially symmetric spherical function by accumulating several independently rotated radially symmetric functions. It's not all that different from storing a list of separate directional lights in some sense. I don't know if this what Halo are doing, although I'll probably have to read that paper now :) It's also worth making the distinction between incoming radiance, which is high frequency and isn't well represented by any kind of SH, and diffuse irradiance, which has the cosine integrated in already. SH are really great at diffuse stuff, but don't handle complexity well. Hope that helps! Thanks, Sam * = non-rigorous terminology :) From: Sébastien Lagarde [mailto:seb...@do...] Sent: 01 February 2010 17:55 To: Game Development Algorithms Subject: Re: [Algorithms] Some question about "Lighting andMaterialofHalo3"and "Lightmap compression in Halo 3" Hi Sam > does not produce a radially symmetric SH In fact I am not sure to understand fully the SH math, that why I ask, I attached a picture showing the part of the "Lighting and MaterialofHalo3" which I will highlight. The equation (4) is the projection of incoming lighting in SH. The equation (5) is the diffuse reflectance equation used in Halo3 They sum the SH coefficient of the incoming lighting multiply by the SH coefficient of the projection of the cosine lobe. As you said, this is a convolution, >From Precomputed radiance transfer for real-time rendering in Dynamic, low-frequency lighting environments (http://research.microsoft.com/en-us/um/people/johnsny/papers/prt.pdf) in the section "convolution" we can read: " In other words, the coefficients of the projected convolution are simply scaled products of the separately projected functions. Note that because h is circularly symmetric about z, its projection coefficients are nonzero only for m=0. The convolution property provides a fast way to convolve an environment map with a hemispherical cosine kernel, defined as h(z) = max(z,0) " So I am a little lost here, I think I misunderstanding the math, in the case of the convolution, as said in the Halo3 paper you get a non nul result when you multiply the coefficient for i = 0, 2 and 6 (based on order 3 SH) so you don't need to store more than 9 SH coefficient ( 3 zonal harmonic for 3 color channel) for the incoming lighting, right ? Is that statement mean that the lighting is radially symmetric SH, I am not sure. > "Zonal" harmonics, where m != 0 are 0 Sorry for the unclarity of my word, I mean that A3 = 0 (notation from halo3 picture joint). the coefficient for A3, A4 etc... can be found in this paper (http://www.eecs.berkeley.edu/~ravir/lighting.pdf) and are not given in halo paper for order > 3 that why I said the zonal hamonic SH coefficient of the 4 band don't need to be store. Thanks to enlighten me :) Lagarde Sébastien |