"Freedom is not worth having if it does not include the freedom to make mistakes."
- Mahatma Gandhi

Framework 4 (Last updated: October 25, 2019)
Framework 3 (Last updated: February 6, 2017)
Framework 2 (Last updated: October 8, 2006)
Framework (Last updated: October 8, 2006)
Libraries (Last updated: September 16, 2004)
Really old framework (Last updated: September 16, 2004)
Friday, November 8, 2002 | Permalink

Source code
Phong.zip (492 KB)

I have implemented a slightly simplified version of the phong lighting model. The lighting equation is evaluated completely in a fragment program. Gone is normalizing cubemaps, 3d texture attenuation and vectorfields and vertex interpolated halfvectors as have been the standard for perpixel lighting on last generation hardware. However, while pushing all this work onto the fragment program gives you much better quality it does also slow things down significantly. Accessing a texture it still much faster than evaluating reciprocals and reciprocal square roots. If you wanted an app for bringing your Radeon 9700 down on it's knees, this demo is what you want , expect around 50fps in 1024x768.

Will run on Radeon 9500/9700 only at this time.

Updated to support both Blinn and Phong models. Type "blinn" or "phong" on the console to change between the different illumination models, default is Phong. Fixed a small mistake with ambient too.