Assignment 3: Spherical Harmonics

CMSC 491/691, Spring 2012

Due Tuesday, March 30, 2012


For this project, you will create a spherical harmonic representation of an environment map and diffuse BRDF, and use the dot product of spherical harmonic vectors to light an object or scene, as described in Robin Green's Spherical Harmonic Lighting paper. Assume a fixed orientation for the object or scene relative to the environment map, so you are just moving your viewpoint relative to the scene and do not need to do spherical harmonic rotations. You should be able to get away with a pretty low-order spherical harmonic for diffuse-only, but use at least 2nd order (9 total terms).

691 students

Add some additional feature from Robin Green's paper: a higher frequency BRDF with spherical harmonic rotation or a transfer matrix, shadowing and/or interreflection, etc.

What to turn in

Submit your work to your class bitbucket repository. Submit your project source, along with any textures or models I will need. If it'll be recreated if you move or delete it, don't check it in. I recommend doing a pull/update of the directory, locally checking in working or partially working files early and —I'll grade the final verison.

Check in a readme.txt file telling me what external sources you used, what you did for your assignment, and what I should notice. Check in all of your source code files, and anything else that cannot be regenerated from them, including any external textures or models. Do not include any compiled object files, libraries or executables. They won't do me any good, and can lead to strange hard to find bugs when compiled code not corresponding to your current source is resurrected from the repository. Do not package all of your files up into a single archive. CVS has limited ability to deal with binary files, and you'll quickly end up using more space than you think you're saving.

If you need your quota increased (now, or at any time during the semester), let me know.

External help

Like the last assignment, I am expecting you will need make heavy use of web resources and sample code. As always, document your sources.


You could do a Monte-Carlo sampling as Green suggests to compute the dot product of environment and spherical harmonic functions, and it is certainly more efficient, but it'll probably be easier to implement if you just evaluate the spherical harmonic function at each texel and do a simple Euler integration. You can precompute this and load or hard-code the coefficients for your environment map.

Robin Green had an excellent presentation on an alternative to spherical harmonics called Spherical Needlets at GDC last week, but I decided to spare you trying to implement that given the short time available for assignment 3. However, you could consider that as a possible technical feature for the final project.