Per-pixel shading and optimizations for Direct3D 8

This is my article from November 2002 about the implementation of per-pixel Phong shading on DX8 class of hardware. Available with the source code.

I re-viewed the article in 2004 and corrected some bugs and grammar.

Also contains:
– Description of the lighting equation
– Description of tangent space
– How to implement a spotlights
– Various implementations for multiple lights per pass.

Download the article
Download the source code