Spherical Harmonics

A key point in color representation comes from the use of Spherical Harmonics (SH). The spherical harmonics are solutions to Laplace's equation in spherical coordinates, orthogonal and forming a complete basis for functions defined on a sphere. This means that any function $L(\theta, \phi)$ can be expanded into a series of spherical harmonics:

\begin{displaymath}
L(\mathbf{d}) = L(\theta, \phi) = \sum_{l=0} \sum_{m=-l}^{m=l} k_{l}^{m} Y_{l}^{m} \left( \theta, \phi \right)
\end{displaymath} (9.91)

This entire class of functions can be generated by a single formula, selecting $l \ge 0$ for the degree of the harmonic and $-l \le m \le l$ for the order:

\begin{displaymath}
Y_l^{m}(\theta,\phi) = \frac{(-1)^l}{2^l l!} \sqrt{ \frac{(...
... \pi (l-m)!} } e^{i m \phi} P_l^{m} \left( \cos \theta \right)
\end{displaymath} (9.92)

where $P_l^{m} \left( \cos \theta \right)$ are the associated Legendre polynomials (YLT$^+$21). In the case of $l = 0$, the first harmonic is a constant on the sphere and is equal to $Y_0^{0} = \frac{1}{2} \sqrt{ \frac{1}{\pi} } \approx 0.282$.

In computer graphics, they are used to represent lighting information in a compact and efficient manner. Spherical Harmonics decompose the incident light into a set of coefficients, each associated with a different harmonic. These coefficients capture the characteristics of light, such as intensity and color, along different directions of the spherical surface.

The idea is to select a maximum degree of $l$ and express each color component (red, green, blue) as a linear combination of spherical harmonics, using $(\theta, \phi)$ as the optical radius that connects the point to the observer.

Paolo medici
2025-10-22