## Re: [Algorithms] Some question about "Lighting and Material of Halo3" and "Lightmap compression in Halo 3"

 Re: [Algorithms] Some question about "Lighting and Material of Halo3" and "Lightmap compression in Halo 3" From: Jon Watte - 2010-01-30 00:38:43 Attachments: Message as HTML ```I don't quite understand your coupling between harmonic orders and coefficients. If I remember correctly, spherical harmonics of order 0 is a flat value -- 1 coefficient. Order 1 adds three cardinal directions -- 3 additional coefficients, for a total of 4. Order 2 adds another 5, for a total of 9. Order 3 adds another 7, for a total of 16. Order 4 adds another 9, for a total of 25. ... You may be able to omit the constant term (calculating it or assuming it) which would get a total harmonic count for order 3 of 15. Perhaps that's where the number comes from (but I have not had time to check the paper, just guessing here). Generally, if you separate out the diffuse/ambient reflection/albedo texture to a "regular" texture, you don't need to store the light response in RGB channels, just like you don't use different light fall-off equations for the different color channels. (Except when you do Rayleigh scattering and similar for atmospherics, I think...) Sincerely, jw -- Americans might object: there is no way we would sacrifice our living standards for the benefit of people in the rest of the world. Nevertheless, whether we get there willingly or not, we shall soon have lower consumption rates, because our present rates are unsustainable. 2010/1/29 Sébastien Lagarde > Hello all, > > > > I tried to contact the author of this two (now old) paper, without > success,: > > "Lighting and Material of Halo 3" published at siggraph 2008 ( > http://ati.amd.com/developer/SIGGRAPH08/Chapter01-Chen-Lighting_and_Material_of_Halo3.pdf > ) > > and GDC 2008 conference "Lightmap compression in Halo 3" ( > http://toomuchlogic.com/Lightmap_Compression_2008_02_22.pdf) > > so I will ask some question to the list, if anyone is interested by the > subject and has better understanding of math than me :) > > > > 1. "Lighting and Material of Halo 3" About equation (5) the diffuse > reflectance using SH basis > > the diffuse reflectance using SH basis is : k_d R_d Sum Lambda_i A_i > > A_i is the projection of the cosine lobe in SH, and as it is radially > symetric. > > all coefficient with m != 0 are 0. > > After that the author give the first three term of A_i. > > I wondering how many band are use for this calculation ? (order 3, 4 or > more ?) > > > > I read from "Stupid spherical harmonics tricks" from Perter Pike sloan ( > http://www.ppsloan.org/publications/StupidSH36.pdf) > > that order 3 SH is sufficient for approximate light source > > but for HDR light sources he recommand order 5. > > As order 4 is 0 (From paper > http://www.eecs.berkeley.edu/~ravir/lighting.pdf I get the formula for > A_i) > > This mean 4 coefficient to store by color channel. > > As I am pretty sure the author store HDR data, can someone lighten me ? > > > > 2. About texture storage (which are deduced from above statement) > > > > I try to figure out how are encoded the incident radiance in their > SHLightmap. > > From GDC 2008 conference "Lightmap compression in Halo 3" I can read that > the author need to > > store for each texel a vector of 5 * 3 float values. > > I don't figure what are the values exactly. > > > > My assumption is that "3" is for each channel color RGB, > > But I can't figure what's the 5 is ? > > Are they 5 first band of SH order like I suppose above (but as I said, we > only need 4 coefficient in this case) > > or maybe order 6 ? > > > > In this same paper later I found: > > A. Two DXT5 texture for each SH coefficient channel (HDR, > positive/negative) > > And > > B. Each band of the SH coefficients (RGB) are converted to Luvw space > > > > I suppose that Luvw space is what is describe in this paper "Rendering from > Compressed High Dynamic Range Textures on > > Programmable Graphics Hardware" by Peter Pike sloan and al.( > ftp://ftp.research.microsoft.com/pub/tr/TR-2006-152.pdf) > > > > What I don't understand is that A and B seem different. I can't understand > what is store. > > Are they storing for each band the triplet RGB of SH coeeficient, mean 3 > float value for two DXT5 x order > > or do they store store 5 SH coefficient for channel color R in two DXT5 ? > > > > So what are the total storage cost of all the 5 * 3 float value in term of > DXT5 texture ? > > Cause It looks like to be pretty big. > > > > Thanks for anyone interested by this post > > > > Best regards > > > > Lagarde Sébastien > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > ```