Submitted by , posted on 16 June 2003



Image Description, by


This is an implementation of Spherical Harmonic Lighting to partially simulate Global Illumination for static models on a per-vertex level, in real-time. The executable itself contains a lot of SH-specific visualisations such as an Associated Legendre plot and 3D representations of the SH bases.

The simulation starts of by generating SH co-efficients for each vertex in 3 types of lighting model: diffuse unshadowed, diffuse shadowed, and diffuse inter-reflected; all lit by an HDR image light source. For each vertex, integration over the sphere is performed using a Monte-Carlo Estimator with 10,000 samples, and then projected onto 4 bands of Spherical Harmonics. For the first time the program starts this will take a while to generate, after which the SH coefficients will be cached to file for you to run again.

There is also an implementation of Ivanic/Ruedenberg's SH rotation algorithm, presented in verbose form that should be easily correlatable with their original paper. This manifests itself in the form of back-rotating the HDR light source SH vector into the model object-space.

Both the source code and executable are available on my webpage for those interested in the technique: http://www.donw.co.uk .



[prev]
Image of the Day Gallery
www.flipcode.com

[next]


 


Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.