4

At page (slide in reality) 12/20 of this tutorial it is shown a function used to project lights into SH coefficients, however the value of those coefficients is not given, what are their values and what they are for?

Do I have to clamp colors to max value of 1 (float) / 255(uint) when adding lights to SH coefficients?

1 Answers1

0

I'm not an expert on Spherical Harmonic (SH), but I'll try to answer.

SH functions are basis functions. That means that they encode a function $f$ this way by a given basis function $B_i$:

$$\int_{}^{} f(x) B_i(x) dx=fConst_i$$

So what we can do is to use the $fConst_i$ to reconstruct an approximation of the function $f$ this way:

$$\sum_{n=1}^{i} fConst_iB(i)$$

In your case they could look like this:

$$ fConst1 = 0.429043; $$ $$ fConst2 = 0.511664; $$ $$ fConst3 = 0.743125; $$ $$ fConst4 = 0.886227; $$ $$ fConst5 = 0.247708; $$

These coefficients approximate diffuse lighting.

CpCd0y
  • 176
  • 5