Shading is the process of altering the color of a surface. Different shading models capture the process of light reflection on a surface. These models use the following variables in the computation:
(ray) - a ray emitted from a pixel, defined with an origin ( ) and a direction ( ). (intersection point) - the intersection point of the surface and . (light direction) - a unit vector pointing from the surface towards a light source, computed by normalizing the vector between the intersection point and the light source position .
(view direction) - a unit vector pointing from the surface towards the place the ray is emitted from. Itβs computed by normalizing the vector between the intersection point and the ray origin .
(surface normal) - a unit vector perpendicular to the surface at the point where the reflection is taking place.- Other characteristics of the light source and the surface, depending on the shading model.