With our shaders, we will implement Phong shading and the Phong reflection model. Remember that Phong shading interpolates vertex normals and creates a normal for every fragment–the processing happens in the fragment shader. The Phong reflection model describes illumination as the addition of ambient, diffuse, and specular interaction of the object with the light sources.
To be consistent with the Material Template Library (MTL) format, we’ll follow some typical conventions to set out uniform names that refer to material properties:
Material Uniform |
Description |
uKa | Ambient property. |
uKd | Diffuse property. |
uKs | Specular property. |
uNi | Optical density. We will not use this feature, but you will see it in the MTL file. |
uNs | Specular exponent. A high exponent results in a tight, concentrated highlight. Ns values normally range from... |