Game Development Reference
In-Depth Information
Figure 13.2: A heightmap as a grayscale
13.1.1 Creating a Heightmap
Heightmaps can be generated either procedurally or in an image editor
such as Adobe Photoshop. Using an image editor is probably the easiest
way to go, and it allows you to create the terrain interactively and visu-
ally as you want it. In addition, you can take advantage of your image
editor features, such as filters, to create interesting heightmaps. Figure
13.3 shows a pyramid-type heightmap created in Adobe Photoshop
using the editing tools. Note that we specify a grayscale map when cre-
ating the image.
Figure 13.3: A
grayscale image
created in Adobe
Photoshop
Once you have finished drawing your heightmap, you need to save it as
an 8-bit RAW file. RAW files simply contain the bytes of the image one
after another. This makes it very easy to read the image into our appli-
cations. Your software may ask you to save the RAW file with a header.
Specify no header.
Team-Fly ®
Search WWH ::




Custom Search