Implementing displacement decals
In this recipe, we will be creating a displacement decal in order to add dynamic detail to a mesh on the GPU in real-time. This technique combines hardware tessellation and displacement to implement local mesh deformations such as footsteps, bullet holes, and craters.
We are using three new textures that are available in the downloaded content for this recipe,
Crater_Normal.png. The completed project can be found in the companion code
How to do it…
We will begin by creating our new
Shaders\CommonDecal.hlsl HLSL shader file. This will introduce a new constant buffer to hold the necessary information that will be applied to our ...