Graphics Reference
In-Depth Information
Figure 8.8. Anisotropic lighting in human hair (left); a sphere with procedural anisotropic
shading (right).
( ) The BRDF may also
take into account behaviors that differ for different wavelengths (or different
colors) of light.
None of the shading models in the fixed-function graphics pipeline of
OpenGL handle anisotropic shading at all, but we can do this within a frag-
ment shader, as described in the chapter on lighting. In the right image in
Figure 8.8, we see an example of a sphere that uses an anisotropic fragment
shader, discussed below. The light returned by the surface is clearly not the
circular spot we would have expected to see from normal (that is, isotropic)
shading; its shape reflects the behavior of brushed metal or threads that all go
through the poles of the sphere.
of the light from the point being lighted: ρ ΘΦΘΦ
e
,
,
,
.
e
l
l
Data-Driven Coloring
One of the really significant capabilities that GLSL shaders give you is the ability
to pass data to the shaders, where it can be used to derive the colors of individ-
ual pixels. We have already alluded to the fact that an application can provide
data to shaders by deining uniform and atribute variables that can be used
freely in developing an image. This idea is also important in scientific visualiza-
tion and will be covered in detail in that chapter, but we describe it briefly here
because this capability is an important part of the idea of the fragment shader.
As an example of using data to color an image, we can get a number of
different kinds of weather data. Say that we want to be able to draw some con-
clusions about the weather from this data. Figure 8.9 shows three images from
the GOES (Geostationary Operational Environmental Satellites) system, dis-
playing a visible light image at the left, a data map of infrared (temperature) in
the center, and a data map of water vapor concentration at the right.
Search WWH ::




Custom Search