From Wiki
Specular Reflection Models
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
called ISOTROPIC. If microfacets are distributed with a preference for a certain direction along the surface, the distribution is
ANISOTROPIC.
1.
Phong Distribution
In the Phong reflection model, the intensity of the specular highlight is calculated as:
Where R is the mirror reflection of the light vector off the surface, and V is the viewpoint vector.
In the Blinn–Phong shading model, the intensity of a specular highlight is calculated as:
Where N is the smooth surface normal and H is the half-angle direction (the direction vector midway between L, the vector to the light, and V, the viewpoint vector).
The number shininess
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 approximately Gaussian distribution (for large
shininess), or approximately Pearson type II distribution, of the corresponding angle. While this is a useful heuristic and produces believable results, it is
NOT a physically based model.
Another similar formula, but only calculated differently:
where R is an eye reflection vector,
E is an eye vector (view vector),
N is surface normal vector. All vectors are
normalized. L is a light vector.
2. Gaussian distribution
A slightly better model of microfacet distribution can be created using a Gaussian distribution. The usual function calculates specular highlight intensity as
where m is a constant between 0 and 1 that controls the apparent smoothness of the surface.
3. Beckmann distribution
A physically based model of microfacet distribution is the Beckmann distribution:
where m is the rms slope of the surface microfacets (the roughness of the material).
Compare 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".
However, this model can be simplified since
Also note that the product of cos(α) and a surface distribution function is normalized over the half-sphere which is obeyed by this function.
4. Heidrich–Seidel anisotropic distribution
The Heidrich–Seidel 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 as brushed metal, satin, and hair. The specular highlight intensity for this
distribution is:
where n is the anisotropic exponent,
V is the viewing direction, L is the direction of incoming light, and
T is the direction parallel to the grooves or fibers at this point on the surface. If you have a unit vector
D which specifies the global direction of the anisotropic distribution, you can compute the vector
T at a given point by the following:
where N is the unit normal vector at that point on the surface. You can also easily compute the cosine of the angle between the vectors by using a property of the dot product and the sine of the angle by using the trigonometric identities.
The anisotropic kspec should be used in conjunction with a non-anisotropic distribution like a Phong distribution to produce
the correct specular highlight.
5.
Ward anisotropic distribution
The specular term is 0 if N·L < 0 or
N·R < 0. All vectors are unit vectors. The vector
R is the mirror reflection of the light vector off the surface,
L is the direction from the surface point to the light,
H is the half-angle direction,
N is the surface normal, and X and
Y are two orthogonal vectors in the normal plane which specify the anisotropic directions.
6. Cook–Torrance model
The Cook–Torrance model uses a specular term of the form:
Here D is the Beckmann distribution factor as above and F is the Fresnel term,
For performance reasons in real-time 3D graphics Schlick's approximation is often used to approximate Fresnel term.
G is the geometric attenuation term, describing selfshadowing due to the microfacets, and is of the form
In these formulas E 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.