Blinn–Phong shading model
From Wikipedia, the free encyclopedia
The Blinn–Phong shading model (also called Blinn–Phong reflection model or modified Phong reflection model) is a modification to the Phong reflection model, trading visual precision for computing efficiency.
In Phong shading, one must continually recalculate the angle between a viewer (V) and the beam from a light-source (L) reflected (R) on a surface.
If we instead calculate a halfway vector between the viewer and light-source vectors,
we can replace with .
This dot product represents the cosine of an angle that is half of the angle represented by Phong's dot product, if V, L, N and R all lie in the same plane. The angle between N and H is therefore sometimes called the halfway angle.
The halfway angle is smaller than the angle we want in Phong's model, but considering that Phong is using , we can set an exponent so that is closer to the former expression. The size of the specular highlights can be matched in this way very closely to a corresponding Phong reflection, but they will always retain a subtly different shape.
Additionally, while it can be seen as an approximation to the Phong model, it produces more accurate models of empirically determined bidirectional reflectance distribution functions than Phong for many types of surfaces. (See: Experimental Validation of Analytical BRDF Models, Siggraph 2004)
Blinn-Phong is the default shading model used in OpenGL, and is carried out on each vertex as it passes down the graphics pipeline; pixel values between vertices are interpolated by Gouraud shading by default, rather than the more expensive Phong shading.
It might seem unlikely that this model is more efficient than Phong, since it contains a square root calculation, while the original Phong model needs a simple vector reflection. However, if we treat the viewer and light to be at infinity, which is common and the default behaviour of, for instance, OpenGL when using directional lights, then the half-angle vector is independent of position and surface curvature, which means that it can be calculated once for each light, and used for the entire frame, or indeed while light and viewpoint remain in the same relative position. The same is not true with Phong's original reflected light vector which depends on the surface curvature and must be recalculated for each pixel of the image (or for each vertex of the model in the case of vertex lighting).
[edit] See also
- Phong reflection model for Phong's corresponding model
- Phong shading
- Gouraud shading
- Specular highlight