# Multiplication of SH coefficient sets representing occlusion and color

Currently I got interested in implementation of Precomputed Radiance Transfer.

I decided that occlusion representation (which is not trivial to compute) would be precomputed as CPU raytracing and stored as vertex buffer in addition to usual vertices. This representation would be stored as SH coefficients because I need to have information about occluded and unoccluded directions (probably 4 so additional vec4 buffer). So these would store only unoccluded directions. I don't know yet how that would behave but using this foreach vertex should make it quite accurate despite being low frequency.

And as for color representation, computing it is quite trivial (transforming image representing skymap scattering and normals into SH set) and I want it to be dynamic so it would be done every frame. These would be 9 coefficients because why not.

So in reconstruction step I would have two sets of coefficients: precomputed occlusion (4 coefficients) and real time color (9 coefficients for RGB so in sum 27 coefficients).

Can I (and how) multiply them (as in the picture below from this paper) so in the result I would get representation with occluded color filtered out?

• I am not too sure to understand your question. SH coefficients assuming you rendered them in a pre-pass already encode visibility information (assuming you are talking about the SH coefficients computed at the vertex of your objects, not the SH coefficients of your env map for example). So are you asking how to convolve the SH coeffs from the env map with the SH coeffs from the vertices? – user18490 Feb 5 '17 at 10:33
• @user18490 Yeah convolve two sets but nevermind, why would I need that actually, reconstruction and multiplication will work. – narthex Feb 5 '17 at 10:49

## 1 Answer

I was overthinking it. The usual reconstruction for given direction and then multiplication will work fine probably.