This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Specular highlight" – news ·newspapers ·books ·scholar ·JSTOR(February 2008) (Learn how and when to remove this message) |
Aspecular highlight is the bright spot oflight that appears on shiny objects when illuminated (for example, see image on right). Specular highlights are important in3D computer graphics, as they provide a strong visual cue for the shape of an object and its location with respect to light sources in the scene.
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(June 2015) (Learn how and when to remove this message) |
The termspecular means that light isperfectly reflected in a mirror-like way from the light source to the viewer. Specular reflection is visible only where thesurface normal is oriented precisely halfway between the direction of incoming light and the direction of the viewer; this is called thehalf-angle direction because it bisects (divides into halves) the angle between the incoming light and the viewer. Thus, a specularly reflecting surface would show a specular highlight as the perfectly sharp reflected image of a light source. However, many shiny objects show blurred specular highlights.
This can be explained by the existence ofmicrofacets. We assume that surfaces that are not perfectly smooth are composed of many very tiny facets, each of which is a perfect specular reflector. These microfacets have normals that are distributed about the normal of the approximating smooth surface. The degree to which microfacet normals differ from the smooth surface normal is determined by the roughness of the surface. At points on the object where the smooth normal is close to the half-angle direction, many of the microfacets point in the half-angle direction and so the specular highlight is bright. As one moves away from the center of the highlight, the smooth normal and the half-angle direction get farther apart; the number of microfacets oriented in the half-angle direction falls, and so the intensity of the highlight falls off to zero.
The specular highlight often reflects the color of the light source, not the color of the reflecting object. This is because many materials have a thin layer of clear material above the surface of the pigmented material. For example, plastic is made up of tiny beads of color suspended in a clear polymer and human skin often has a thin layer of oil or sweat above the pigmented cells. Such materials will show specular highlights in which all parts of the color spectrum are reflected equally. On metallic materials such as gold the color of the specular highlight will reflect the color of the material.
A number of different models exist to predict the distribution of microfacets. Most assume that the microfacet normals are distributed evenly around the normal; these models are calledisotropic. If microfacets are distributed with a preference for a certain direction along the surface, the distribution isanisotropic.
NOTE: In most equations, when it says it means
In thePhong reflection model, the intensity of the specular highlight is calculated as:
WhereR is the mirror reflection of the light vector off the surface, andV is the viewpoint vector.
In theBlinn–Phong shading model, the intensity of a specular highlight is calculated as:
WhereN is the smooth surface normal andH is the half-angle direction (the direction vector midway betweenL, the vector to the light, andV, the viewpoint vector).
The numbern is called the Phong exponent, and is a user-chosen value that controls the apparent smoothness of the surface. These equations imply that the distribution of microfacet normals is an approximatelyGaussian distribution (for large), or approximatelyPearson type II distribution, of the corresponding angle.[1] While this is a usefulheuristic and produces believable results, it is not aphysically based model.
A slightly better model of microfacet distribution can be created using aGaussian distribution.[citation needed] The usual function calculates specular highlight intensity as:
wherem is a constant between 0 and 1 that controls the apparent smoothness of the surface.[2]
A physically based model of microfacet distribution is the Beckmann distribution:[3]
wherem is therms slope of the surface microfacets (the roughness of the material).[4] Compared to the empirical models above, this function "gives the absolute magnitude of the reflectance without introducing arbitrary constants; the disadvantage is that it requires more computation".[5]However, this model can be simplified since.Also note that the product of and a surface distribution function is normalized over the half-sphere whichis obeyed by this function.
The Heidrich–Seidel.[6] distribution is a simple anisotropic distribution, based on the Phong model. It can be used to model surfaces that have small parallel grooves or fibers, such asbrushed metal, satin, and hair.
Input parameters:
All vectors are unit.
If some of the conditions are not satisfied from the list then the color is zero
Note: This list is not optimized.
First we need to correct original direction of fiberD to be perpendicular to real surface normalN.This can be done by projection fiber direction on to plane with normalN:
It is expected that fiber is cylindrical. Note the fact that normal of fiber depends on light position. Normal of fiber at given point is:
Reflected ray needed for specular calculation:
Calculation ofR andP are expensive operation. To avoid their calculation original formula can be rewritten in next form:
T can be observed as bump normal and after that it is possible to apply other BRDF than Phong. The anisotropic should be used in conjunction with an isotropic distribution like a Phong distribution to produce the correct specular highlight
The Ward anisotropic distribution[1] uses two user-controllable parametersαx andαy to control the anisotropy. If the two parameters are equal, then an isotropic highlight results. The specular term in the distribution is:
The specular term is zero ifN·L < 0 orN·V < 0. All vectors are unit vectors. The vectorV is the viewing direction,L is the direction from the surface point to the light,H is the half-angle direction betweenV andL,N is the surface normal, andX andY are two orthogonal vectors in the normal plane which specify the anisotropic directions.
The Cook–Torrance model[5] uses a specular term of the form
Here D is theBeckmann distribution factor as above and F is theFresnel term. For performance reasons, in real-time 3D graphicsSchlick's approximation is often used to approximate the Fresnel term.
G is the geometric attenuation term, describing selfshadowing due to the microfacets, and is of the form
In these formulas V is the vector to the camera or eye, H is the half-angle vector, L is the vector to the light source and N is the normal vector, and α is the angle between H and N.
If desired, different distributions (usually, using the same distribution function with different values ofm orn) can be combined using a weighted average. This is useful for modelling, for example, surfaces that have small smooth and rough patches rather than uniform roughness.