News
30 November 2007 -- Source and Windows executable are now available for download (see Licence and Downloads page).
About this Space
This space is for an ongoing 3D computer graphics project -- Spherical Harmonic (SH) Lighting Program, which is carried by S.-L. Tracy Huang and Dr. Ian G. Lisle.
This project started from a one-semester research project studies (ISES 2) under School of Information Sciences and Engineering (ISE) in Semester 2, 2006. We continue to work on the project ever since.
Objective of this Space
We would like to share our learning outcomes and resource to people who are interested in SH Lighting.
Other purposes of this space:
- Recording progress of the project
- Storing/organising reference materials
- Keeping motivated in continue working on the project by stating tasks
Spherical Harmonic Lighting Project
The project is to implement a global illumination lighting method in computer graphics called spherical harmonic lighting model. This model was only introduced in 2001 and still new to computer graphics. To achieve this objective, we use Monte Carlo integration for approximating the lighting equation and spherical harmonics for approximating each term of the lighting equation. We also use the ideas of the Wigner D-matrix and the addition theorem for performing rotation on both cases. The Ray-tracing method is also involved for our ray-object intersection test. All our calculations work for arbitrary degree spherical harmonics.
The code is a vanilla C application using OpenGL -- no C++ constructs. Shader language GLSL was used for unshadowed SH case, but SH lighting requires too many vertex attributes -- later code uses CPU for lighting calculation.
The idea is to implement SH lighting from scratch -- deriving mathematical results carefully and basing implementation on those. We did not want to issue DirectX calls, nor to reuse other people's code without understanding.
The program mainly show how the spherical harmonic lighting can be performed in a 3D computer graphic scene. We also focus on flexibility of the program such as mouse control, easy switch menu... etc.
Functionality of the Program so far:
- Perform 3D Computer Lighting models as follows:
- OpenGL Standard Lighting
- SH Diffuse Unshadowed Lighting Model
- SH Diffuse Shadowed Lighting Model
- SH Diffuse Shadowed + Interreflected Lighting Model
- SH Diffuse Interreflected Only Lighting Model
- Can perform rotation at run time.
- Read mesh data in 3ds format and write it as a scene in 3ds format.
- Write into a file for storing SH coefficients of a scene
- Generate SH lighting coefficients from light probes
- Menus for easy switching at run time of lighting models, SH degree, light probes, scenes, ... , etc. (scene switching function is broken at a moment, will fix this shortly)
- Texture mapping light probe skybox for realistic background.
Flexible and Efficient Program:
- Use Wigner matrices for rotation (Z-Y-Z Euler angles convention, with 3-term recurrence for Y-Wigner) -- to arbitrary SH degree -- no hard wired matrices.
- Use efficient algebraic recurrence for calculating SH values -- faster than the method in the Gritty Details.
- Calculates diffuse unshadowed SH coefficients by using SH expansion of circularly symmetric function (no ray casting).
Screen Shots of the Program
Link to the screen shots page.
Downloads
Link to download page
Implementation History
Link to the implementation history page
Current task of the project
Link to the project Tasks
Suggestions for this UCSpace
Please feel free to make comments, or email us
Tracy Huang -- Tracy.Huang@canberra.edu.au
Ian Lisle -- Ian.Lisle@canberra.edu.au