Hello guys!
I am having hard time trying to understand the subject.
Sir Sloan in his Stupid Spherical Harmonics (Projection from Cube Maps section) provides pseudo-code for the implementation.
1.He mentions that the result has to be normalized and I do not really understand what he means here (4*PI/fWtSum multiplier).
2.Should not multiplication on the solid angle of the projected cube map texel on the unit sphere be sufficient?
Also, I found another implementation for the procedure in the Physically Based Rendering book by Matt Pharr.
The authors expand more on how solid angle on the unit sphere is related to the texel area in the cube map using formula
dW = dA / (x*x + y*y + 1)^(3/2).
Their implementation looks the following way
Vector w(u, v, 1.0f);
float dA = 1.0f / powf(Dot(w, w), 3.0f / 2.0f);
coeffs[k] += texelColor * Ylm[k] * dA * (4.0f * resolution * resolution);
3.Still I cannot buy how they calculate dA (texel area) in the code snippet. Is it really texel area (if to believe their original notations).
It looks like dA is in fact solid angle dW.
4.Again, I do not really understand the role of multiplier (4.0f * resolution * resolution).
I would be very appreciative if you could provide some insights into the derivation behind the integration process.
Thanks!