Hi!

I'm trying to include in my code something like is done here: http://seblagarde.wordpress.com/2012/06/10/amd-cubemapgen-for-physically-based-rendering/ for the irradiance map computation.

Now although my code is a bit different, it strongly resemble what is in the post I linked before. Or at least I think so.

The problem is that for the cubemap that is there as reference:

I obtain this result which is both different from the one in the site and also doesn't have the reddish hue that I was expecting:

I can post the code but is* *quite a lot. Is there evident what can be wrong?

What I'm doing is:

For each face

for each u,v

Compute direction vector for (u,v)

Get solid angle

Compute SH terms using the "Y"s found on *Stupid SH Tricks * (

Use these to project the above said vector in SH

for each u,v .... SHTerms = getSHTerms(...); for(int i=0; i<SHTerms.size(); i++){ projected.at(i) += RGB * SHTerms.at(i) * solidAngle; }

Normalize each of these projected multiplying by 4*pi/sumSolidAngles

Then, with these projected values I get back to the env map using a formula like projectedValue * SHTerm(i) * band(i) where i loops through the number of SH terms (the "Ys" )

These values are written back to the various cube faces and the result is the one posted above.

What can be wrong? Thank you very much.