Graphics Reference
In-Depth Information
Figure 6.6. Specular lighting with the half-angle formulation (left) and full-angle formulation (right).
ent from the similar term in the reflection vector formulation. In general, the
half-angle formulation for specularity gives a slightly less-focused specular
highlight than the reflected-light version. Since the shininess coefficient SH is
simply an approximation that is adjusted for visual effect anyway, the differ-
ence is only qualitative. You can see this qualitative difference in Figure 6.6,
which shows the half-angle formulation on the left, and the full-angle formu-
lation on the right.
In fact, it is sometimes possible to get even beter shading than Phong
shading. For some kinds of applications, it is possible to compute exact normals
at each pixel instead of simply interpolating vertex normals. We call this exact
shading , and we discuss it further in Chapter 8.
Anisotropic Shading
Anisotropic shading is another per-pixel color computation that is not available
in fixed-function OpenGL. Anisotropic shading is shading in which specular
light is not reflected equally in all directions from the surface. An example of
this is shown in Figure 6.7, which simulates a sphere for which light is reflected
more strongly in a direction perpendicular to the arc from the poles through
the point. Note that the bright spot in the figure is not circular because the
material has different properties in different directions. Materials such as fur,
hair, and brushed metal behave this way [22].
If you are writing shaders to implement anisotropic shading, the vertex
shader must send the usual information, such as the normal, the eye position,
and the light position, into the fragment shader, in the same way as would be
Search WWH ::




Custom Search