Notes
Outline
CS 563 Advanced Topics in
Computer Graphics
Spherical Harmonic Lighting: Update
 by Cliff Lindsay
Concept: Spherical harmonic Lighting
Concepts:
Approximate Predetermined Lighting Function With Spherical Harmonics
Lighting Function Is an HDR Image, with other Area Lights
Implement Spherical Harmonic Lighting in Maya
Use a Paul Debevec HDR Image as the Predetermined Light function
Create a Spherical Harmonic lighting/shading plug-in for Maya using the Maya API in C++
Additional lights will be added to illuminate the scene
Models (i.e., boxes, spheres, cones, etc)
Scope: Diffuse and Ambient Lighting
In Scope:
Diffuse Unshadowed Transfer
HDRI Lighting
Out Of Scope:
Diffuse Shadowed Transfer
Diffuse Inter-reflected Transfer
Progress Thus Far
Done:
Generated HDR Image to use a texture map for lighting sphere
Mel Script for Generating additional Area Lights
Complex Models: Happy Buddha, Stanford Rabbit, Armadillo, etc.
Projecting Light functions to SH Space
Generated Coefficients for lighting approximation
Method For Sampling Light Sphere
TBD:
Verify Projection of HDR Images w/ Matlab
Preprocessing Import Tools for Maya to Calculate SH approximation for BRDF
Done: Details
Generated HDR Image to use a texture map for lighting sphere:
Manipulated an HDR image, converting it from HDR format to an Angle Map format.
Converted the angle map into a diffuse/specular map.
Done: Details
Wrote a Maya C++ plug-in for Lambertian surfaces.
Configured Maya to use the plug-in for specified surfaces.
Projecting Light functions to SH Space:
Wrote classes/function to convert a HDR/Angle Map file to a approximated lighting function
Tools produce a set of coefficients for approximating the light function.
Done: Details
Acquired more complex models for proposed scene:
Converted models from the Stanford repository (.ply models) to a format that was compatible with Maya (.obj models).
Wrote a Mel script generate scene:
Mel script was needed to create and configure lights, models, and connect certain Maya and Spherical Harmonic nodes to these models.
Apply certain attributes to light and models.
Future: Details
Additional Import Tools Needed for Maya Plug-in:
To approximate the BRDF for a surface in SH space we need all geometry information for the surface.
Maya’s Architecture allows for sampling a single point per pass only (in plug-ins). But we can render use the ray tracinf utilities in Maya to cast rays for our own shadows.
Road Blocks
Maya’s Architecture (Two APIs to Learn):
Mel scripting – Nice scripting API but very extensive. Maya is built exclusively with Mel so it need a lot of features.
Development API(C/C++) – Necessary for creating new internal nodes and data types. Very restrictive, data flow non-intuitive, type-less data and data blocks.
Maya’s ray tracing/plug-in architecture give access to a single sampling of environment instead of all environment.
Road Blocks
Maya’s Architecture:
Too Many features to learn in a very limited time.
Development Books and API documentation is geared for Artists and novice developers. Lacked advanced level documentation.
Ideas
Use a Nurb Sphere as a lighting function with a texture that represents light color, intensity, etc.
Conclusion: Bad Idea! This type of method doesn’t work well with Maya’s Architecture.
Images: HDR in Latitude/Longitude Format
Images: HDR Diffuse and Specular Convolution
Images: 1 Shape SH Vs. Lambertian
Images: SH Multi-Shapes Vs. Lambertian
Images: Final Image With Additional Lights
References: