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

CC BY-SA 3.0
2017-02-05T10:34:22.213Z
2017-02-05T10:34:22.213Z
mdkdy
<p>Currently I got interested in implementation of Precomputed Radiance Transfer. </p>

<p>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 <code>vec4</code> 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.</p>

<p>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.</p>

<p>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). </p>

<p>Can I (and how) multiply them (as in the picture below from <a href="http://www.inf.ufrgs.br/~oliveira/pubs_files/Slomp_Oliveira_Patricio-Tutorial-PRT.pdf" rel="nofollow noreferrer">this paper</a>) so in the result I would get representation with occluded color filtered out?</p>

<p><a href="https://i.sstatic.net/oJomp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oJomp.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2017-02-05T10:33:48.910Z
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
CC BY-SA 3.0
2017-02-05T10:49:26.050Z
@user18490 Yeah convolve two sets but nevermind, why would I need that actually,  reconstruction and multiplication will work.
mdkdy
<lighting><global-illumination><spherical-harmonics>
Multiplication of SH coefficient sets representing occlusion and color
mdkdy
# Multiplication of SH coefficient sets representing occlusion and color

(Asked by: username_0 on 2017-02-03)

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](http://www.inf.ufrgs.br/~oliveira/pubs_files/Slomp_Oliveira_Patricio-Tutorial-PRT.pdf)) so in the result I would get representation with occluded color filtered out?

[![enter image description here](https://i.sstatic.net/oJomp.png)](https://i.sstatic.net/oJomp.png)

**Tags:** lighting, global-illumination, spherical-harmonics

> **Comments:**
> **username_1**: 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?  
> **username_0**: @username_1 Yeah convolve two sets but nevermind, why would I need that actually,  reconstruction and multiplication will work.  

---

## 1 answers

### Answer by username_0 on 2017-02-05. Score: 0 | Accepted answer

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


---

