In the simplest shading model, the outgoing radiance on a surface is the combination of diffuse radiance (following Lambert's law) and specular radiance of all light sources:
where
- is the view ray pointing from surface to eye
- is the number of light sources
- is the diffuse color
- is piecewise multiplication
- is light irradiance/intensity, of RGB components
- is cosine value clamped to [0, 1]
- is the normalized light ray pointing from surface to light source
- is the normalized surface normal
- is the smoothness of the surface
- is called half vector
- is the specular color
There are different implementations of this shading equation, regarding the frequency of evaluation:
- Flat (left): per-primitive normal, per-primitive evaluation
- Gouraud (middle): per-vertex normal, per-vertex evaluation
- Phong (right): per-vertex normal, per-pixel evaluation
Note that the "Phong" term above refers to "Phong shading", different from "(Blinn-)Phong reflection model", which describes a simplified shading equation and takes into account the ambient lights.