March 2013
Intermediate to advanced
984 pages
26h 18m
English
A final technique we’ll discuss in terms of tessellation is displacement mapping, which is merely a form of vertex texture mapping, like we described in Chapter 6, “Textures”. In fact, there’s really not much to say, other than you would likely use the tessellation coordinate provided to the tessellation evaluation shader in some manner to sample a texture map containing displacement information.
Adding displacement mapping to the teapot from Example 9.9, would requite adding two lines into the tessellation evaluation shader, as shown in Example 9.13.
Example 9.13. Displacement Mapping in main Routine of the Teapot Tessellation Evaluation Shader
#version 420 corelayout (quads, equal_spacing, ...