Spherical Harmonics

Spherical Harmonics 1   Spherical Harmonics 2

Description:

This program displays a simple looking scene (actually containing approximately 25,000 vertices) which can be lit in 3 different ways. As well as standard OpenGL lighting, the scene can be lit by two techniques which make use of spherical harmonics. This method produces global illumination style images in real time, but usually only for static objects.

The first time this demo is executed, it will take approximately 30 minutes (AMD Athlon XP 2000) to generate the spherical harmonic coefficients at each vertex. These are then saved to a file so they can be retrieved quickly in future. If you do not want to wait for the coefficients to be calculated, the file containing them is available as the separate download "shcoeffs.zip", below.

For information on the theory behind this project, see the technical information page.

Requirements:

No Extensions required.

References:

Spherical Harmonic Lighting, the Gritty Details, by Robin Green. http://www.research.scea.com/gdc2003/spherical-harmonic-lighting.html

Download:

Project executable and source: sh.zip (426 KB)

Lighting coefficients: shcoeffs.zip (1.67 MB)