Spherical Harmonics
What the parent explanation assumed you knew:
You understand that Gaussians can change color based on viewing direction, and that 'spherical harmonic coefficients' somehow encode this view-dependent color compactly.
What this page explains:
What spherical harmonics actually are, why they're perfect for encoding directional functions, and how 3DGS uses them for color.
The Explanation
Spherical harmonics (SH) are a set of mathematical functions defined on the surface of a sphere. Think of them like Fourier series, but for spherical data instead of 1D signals.
**The Basics:**
- •Degree 0 (1 coefficient): Constant value in all directions
- •Degree 1 (4 total coefficients): Basic directional variation (brighter on top, dimmer below)
- •Degree 2 (9 total coefficients): More complex patterns (bright from two sides)
- •Degree 3+ (16+ coefficients): Increasingly detailed angular patterns
How 3DGS Uses SH: For each Gaussian, instead of storing one RGB color, we store SH coefficients for R, G, and B separately. To get the color from a specific viewing direction:
1. Evaluate the SH basis functions for that direction 2. Multiply by the stored coefficients 3. Sum up the result
This gives us view-dependent color with just a few numbers per Gaussian.
Why This Works: Most real-world view-dependent effects (specular highlights, subsurface scattering) are 'smooth' - they don't have sharp discontinuities. Low-degree SH captures these smooth variations efficiently.
Visual Aid
Toggle SH degrees on/off to see how each level adds detail. Rotate the view to see color change with direction.
Open interactive demo →The "Aha" Moment
Spherical harmonics let us store 'a function of direction' as a small list of numbers - it's compression for angular patterns.
Go Even Deeper
This explanation assumes you understand these fundamentals. Click to learn more:
trigonometry
Level 1 fundamental
fourier intuition
Level 1 fundamental