Graphics Reference
In-Depth Information
There's more…
As mentioned previously, it is important to consider whether to perform the lighting
calculations for normal mapping in tangent space or world space. This will greatly reduce the
number of matrix operations performed within the pixel shader. However, it can also increase
the amount of information needed in the PixelShaderInput , and it can introduce some
additional complexity to our vertex, hull, domain and geometry shaders.
See also
F For information about manually calculating tangents for an arbitrary mesh, refer to
http://www.terathon.com/code/tangent.html
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 we made in the Adding surface detail
with normal mapping recipe, including the additional assets that were added within the
Getting ready section—these include the displacement maps.
We will also need to implement the changes necessary to support tessellation from the
previous chapter's recipe Mesh refinement with Phong Tessellation .
 
Search WWH ::




Custom Search