Introduction to spherical harmonics for graphics programmers
66 points
by luu
2 days ago
| 3 comments
| gpfault.net
| HN
maho
9 minutes ago
[-]
+1 for introducing them as real-valued functions over cartesian coordinates!

Typically, spherical harmonics are introduced as a complex function over spherical coordinates, which makes them much easier to derive, but imo hides their beauty.

The real-valued, cartesian form of regular spherical harmonics is also called "solid harmonics" or "harmonic polynomials", in case you want to dig deeper.

reply
hackingonempty
4 hours ago
[-]
> spherical harmonics can have uses beyond lighting

This math is also used in Ambisonic surround sound though newer techniques use planewave expansion.

For games, the full-sphere encoding of Ambisonic B-format can be decoded for arbitrary speaker locations and the soundfield rotated around any axis. I'm not sure if its ever been used for a game though.

reply
vatsachak
1 hour ago
[-]
Ambisonics can give one end game audio
reply
analog31
2 hours ago
[-]
... also quantum mechanics. The textbook solution for the wavefunction of the hydrogen atom involves spherical harmonics.
reply
hackingonempty
2 hours ago
[-]
That fact is betrayed by the the similarity of the shapes of atomic orbitals and the sensitivity patterns of Abisonic B-format channels.

https://en.wikipedia.org/wiki/Ambisonics#Higher-order_ambiso...

https://en.wikipedia.org/wiki/Atomic_orbital#Orbitals_table

...and the same patterns appear on the unit disk with the Zernike polynomials, used to describe optical aberrations and more.

https://en.wikipedia.org/wiki/Zernike_polynomials

reply
vatsachak
1 hour ago
[-]
Awesome write up. Is the appeal of spherical harmonics in graphics compression?

Like, if you know the third order harmonics that's only 16 values you have to pass around

reply
djmips
53 minutes ago
[-]
For sure that's a big reason but it's also a useful basis for doing lighting calculations because of their sphere like nature. They are quite efficient in dynamic scenes and historically used in a lot of precalc to do something akin to real time Global Illumination
reply