Adding surface detail with displacement mapping
In this recipe, we will use displacement mapping via the tessellation pipeline to add additional geometric detail to an otherwise smooth or flat surface. This is the key technique used for approximating the detail on high-poly meshes using a low-poly version of the same mesh.
Displacement mapping uses a displacement map texture (also known as a height map) that consists of a single channel that is used to control the amount to displace a vertex. Depending on the method of construction, this height map can have a midpoint that allows the vertex to be lowered/raised, or the map may only support displacement in one direction. A displacement map will generally use the same UV coordinates as the diffuse texture and normal map. We will make changes to our existing tessellation shaders and incorporate displacement mapping to the solution to improve the surface detail of the final render.
Getting ready
In this recipe, we require the normal mapping changes...