From Nvidia Developer Zone:
surfaceColor = emissive + ambient + diffuse + specular
Here,
emissive = Ke
where:
- Ke is the material's emissive color.
ambient = Ka x globalAmbient
where:
- Ka is the material's ambient reflectance and
- globalAmbient is the color of the incoming ambient light.
diffuse = Kd x lightColor x max(N · L, 0)
where:
- Kd is the material's diffuse color,
- lightColor is the color of the incoming diffuse light,
- N is the normalized surface normal,
- L is the normalized vector toward the light source, and
- P is the point being shaded.
specular = Ks x lightColor x facing x (max(N · H, 0))^shininess
where:
- Ks is the material's specular color,
- lightColor is the color of the incoming specular light,
- N is the normalized surface normal,
- V is the normalized vector toward the viewpoint,
- L is the normalized vector toward the light source,
- H is the normalized vector that is halfway between V and L,
- P is the point being shaded, and
- facing is 1 if N · L is greater than 0, and 0 otherwise.