Spherical Harmonics Rotation

Started by
22 comments, last by DarkChris 13 years, 5 months ago
I don't want to "leak" too much at the moment, but trust me... I'm only able to calculate the transfer coefficients in tangent space. But I believe I can just replace the already existing A coefficients and than calculate the World Space PRT lighting, just like you tried to explain it to me.
Advertisement
Quote:Original post by David Neubelt
let me clear up the confusion.

Yes, as I awoke this morning the suspicion entered my mind that the A's you wrote down are used to project an oriented clamped cosine into SH, while I was thinking about the actual SH coefficients of a fixed lobe aligned with the z axis. So the last equation you wrote down in the post above is basically a on-the-fly projection of the oriented cosine combined with the approximation of the double-product integral of the cosine factor and the incident radiance.
Thanks for the explanation and sorry for the interference.

EDIT: fixed typo
Let's imagine a few different scenarios,

1) Combining normal mapping with world space PRT
If you are doing PRT and you want to do it in tangent space because you want to do normal mapping or evaluate a BRDF then you do the following.

Calculate the visibility, diffuse transfer, etc. in world space. Call that set of coefficients T for transfer.

Calculate the incident lighting (env map for example) and call that I.

Then you have your BRDF C, which is the A's, and your basis function y(n)

The final equation is,

y(n)^TCRMI.

This equation is described in more detail in the siggraph 2005 spherical harmonics course. The best description of the equation is in the "Normal Mapping for Precomputed Radiance Transfer" power point presentation by peter pike sloan. Please notice that C is a diagnol matrix with the cosine term which means the A coefficients get multiplied by all the incident lighting coefficients there are no zero's in the equation that cancel it out.

2) Computing the visibility term into a texture for runtime visibility normal mapping.

"Normal Mapping with Low-Frequency Precomputed Visibility"

In this case they store the visibility term in a texture and then store the incident lighting coefficients for every normal direction (in a cube map). Of course, even in this case you'd still want to computer your visibility in world space.

3) Store incident radiance in a sh lightmap and sample at runtime to combine with normal mapping (pretty much what halo 3 does and march of the froblins demo).

In this case you store your incident radiance in worldspace and use the formula from ravi's irradiance environment maps.

4) Basic PRT (such as the paper by peter pike sloan or robin green).
In this case you store PRT in world space and incident lighting in world space and do a dot product between the PRT and incident lighting SH.


Anyway, in almost all cases I've ever seen you would never multiply any part of the bands by 0. If you want further help you'll have to describe your situation, sorry.

-= Dave
Graphics Programmer - Ready At Dawn Studios
I guess, that's all the help I needed. I'm pretty confident that it'll work after the changes and will even be significantly faster since their won't be any rotation involved anymore.

I'll post an update if it actually worked tomorrow. But like always. I'm so glad that you helped me. Big thanks to both of you.

This topic is closed to new replies.

Advertisement