Shading Models

 
 
 

Shading models determine how an object's surface appears under different lighting conditions. Several kinds of mathematical models can be used to calculate the shading. Each shading model processes the relation of surface normals to the light source to create a particular shading effect.

Phong

Uses ambient, diffuse, and specular colors. This shading model reads the surface normals' orientation and interpolates between them to create an appearance of smooth shading. It also processes the relation between normals, the light, and the camera's point of view to create a specular highlight.

The result is a smoothly shaded object with diffuse and ambient areas of illumination on its surface and a specular highlight so that the object appears shiny, like a billiard ball or plastic. Reflectivity, transparency, refraction, and texture can be applied to an object shaded with a Phong shader.

Lambert

Uses the ambient and diffuse colors to create a matte surface with no specular highlights. It interpolates between normals of adjacent surface triangles so that the shading changes progressively, creating a matte surface.

The result is a smoothly shaded object, like an egg or a ping-pong ball. Reflectivity, transparency, refraction, and texture can be applied to an object shaded with a Lambert shader.

Blinn

Uses diffuse, ambient, and specular color, as well as a refractive index for calculating the specular highlight. This shading model produces results that are virtually identical to the Phong shading model except that the shape of the specular highlight reflects the actual lighting more accurately when there is a high angle of incidence between the camera and the light.

This shading model is useful for rough or sharp edges and simulating a metal surface. The specular highlight also appears brighter than the Phong model. Reflectivity, transparency, refraction, and texture can be applied to an object shaded with a Blinn shader.

Cook-Torrance

Uses diffuse, ambient, and specular color, as well as a refractive index used to calculate the specular highlight. It reads the surface normals' orientation and interpolates between them to create an appearance of smooth shading. It also processes the relation between normals, the light, and the camera's point of view to create a specular highlight.

This shading model produces results that are somewhere between the Blinn and Lambert shading models and is useful for simulating smooth and reflective objects, such as leather. Reflectivity, transparency, refraction, and texture can be applied to an object shaded with a Cook-Torrance shader.

Because this shading model is more complex to calculate, it takes longer to render than the other shading models.

Strauss

Uses only the diffuse color to simulate a metal surface. The surface's specular is defined with smoothness and "metalness" parameters that control the diffuse to specular ratio as well as reflectivity and highlights.

Reflectivity, transparency, refraction, and texture can be applied to an object shaded with a Strauss shader.

Anisotropic

Sometimes called Ward, this shading model simulates a glossy surface using an ambient, diffuse, and a glossy color. To create a "brushed" effect, such as brushed aluminum, it is possible to define the specular color's orientation based on the object's surface orientation. The specular is calculated using UV coordinates.

Reflectivity, transparency, refraction, and texture can be applied to an object shaded with an anisotropic shader.

Constant

Uses only the diffuse color. It ignores the orientation of surface normals. All the object's surface triangles are considered to have the same orientation and be the same distance from the light.

It yields an object whose surface appears to have no shading at all, like a paper cutout. This can be useful when you want to add static blur to an object so that there is no specular or ambient light. It also provides good support for textures because there are no attributes to interfere with the texture's definitions.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License