Create a Terrain
from a Heightmap in Unity

Download Heightmaps & Textures

With heightmaps and textures from you can easily create terrains for games in Unity (game engine). Prepare the heightmap and texture with Photoshop or the free image editing software GIMP. For the following tutorial we used GIMP.

Get heightmap + texture from tutorial
Get Unity

1. Prepare the images in GIMP

1. Open the heightmap and the matching texture in GIMP. Place both images in one document.

2. Scale the document on the shortest side to 1024 px.
Image > Scale Image

3. Set the image canvas size on the long side to 1024 px, too. Select the section and resize it.
Image > Canvas Size …

4. Now export the texture layer as a PNG file.
File > Export as …

5. Hide the texture layer and flatten the image.
Image > Flatten Image

6. Convert the image into 16 bit.
Image > Precision > 16 bit integer

7. Convert the image into grayscale.
Image > Mode > Grayscale

8. Export the image as a PNG file.

8. Now export the heightmap as a data.raw file.
File > Export as …

2. Create a Terrain in Unity

1. Open Unity and create a new terrain.
GameObject > 3D Object > Terrain

2. Import the heightmap (raw file).
Inspector > Terrain Settings > Import RAW

3. Set the heightmap width and height to 1024 px.

4. Import the texture.
Assets > Import New Asset …

5. Create a new terrain layer.
Inspector > Paint Terrain > Edit Terrain Layers >Create Layer

6. In Tiling Setting define the texture size for the new layer.