I am working on generating a spherical harmonics irradiance environment map for diffuse lighting. I've read various papers on the topic ([1], [2], [3], [4]), and I've set to work implementing the process as a set of compute shaders. I'm struggling with getting the right result.
I've iterated over an input cubemap and generated 9 coefficients each for R, G, and B. I have a function to evaluate the coefficients for a direction. When generating the output cubemap, do I just store this evaluation at each texel, or do I store the evaluation multiplied by the corresponding texel read from the input cubemap?
