Visual improvements
The game functionality of Tank Battles is now complete, but aside from gameplay improvements (see the end of this chapter for suggestions on things you could implement) there are a number of graphical improvements we can make to Tank Battles to make it more visually appealing. We will add lighting to our terrain, and implement multitexturing to vary the appearance of areas of the terrain based on their elevation.
While we will still only scratch the surface of what we could potentially do with XNA and HLSL, let's look at a few topics that will give us a taste of the graphical power at our disposal.
Lighting
Right now, our terrain is fairly drab. Everything is uniformly lit, which gives the terrain a bland appearance. By adjusting and expanding the way we create the vertex buffer for our terrain, along with a little HLSL modification, we can give our landscape a realistic lighting.
Our first step is to generate normals for each of the vertices in the vertex buffer. A normal...