Game Engine Architecture

(Ben Green) #1
471

Height maps are oft en used for parallax mapping and relief mapping —two
techniques that can make a planar surface appear to have rather extreme
height variation that properly self-occludes and self-shadows. Figure 10.49
shows an example of parallax occlusion mapping implemented in DirectX 9.
A height map can also be used as a cheap way to generate surface normals.
This technique was used in the early days of bump mapping. Nowadays, most
game engines store surface normal information explicitly in a normal map,
rather than calculating the normals from a height map.


10.3.1.3. Specular/Gloss Maps


When light refl ects directly off a shiny surface, we call this specular refl ection.
The intensity of a specular refl ection depends on the relative angles of the
viewer, the light source, and the surface normal. As we saw in Section 10.1.3.2,
the specular intensity takes the form kS(RV⋅ ),α where R is the refl ection of
the light’s direction vector about the surface normal, V is the direction to the
viewer, kS is the overall specular refl ectivity of the surface, and α is called the
specular power.
Many surfaces aren’t uniformly glossy. For example, when a person’s face
is sweaty and dirty, wet regions appear shiny, while dry or dirty areas appear
dull. We can encode high-detail specularity information in a special texture
map known as a specular map.
If we store the value of kS in the texels of a specular map, we can control
how much specular refl ection should be applied at each texel. This kind of
specular map is sometimes called a gloss map. It is also called a specular mask,
because zero-valued texels can be used to “mask off ” regions of the surface
where we do not want specular refl ection applied. If we store the value of α
in our specular map, we can control the amount of “focus” our specular high-


Figure 10.49. DirectX 9 parallax occlusion mapping. The surface is actually a fl at disc; a height
map texture is used to defi ne the surface details.


10.3. Advanced Lighting and Global Illumination

Free download pdf