Blender - Creating a Heightmap for Unreal Engine Landscape in Blender

Tutorial / 02 October 2020

About these tips and tricks

I find it slow when I have to go find a YouTube tutorial to remind myself how to do some thing in Unreal Engine or Blender. These blog posts will summarise the steps and refer to the original video, to help me in the future and, I hope, may help you.

Creating a Heightmap for Unreal Engine Landscape in Blender

Mirage YouTube

I find sculpting from a blank canvas in Unreal Engine tricky. You have to zoom into an area to be able to sculpt so getting the big picture is difficult. To make it easier like to create a heightmap to apply to the Unreal landscape as a starting point.

There are a number of ways to obtain a heightmap from real world data, but these are often more trouble than they are worth. Most rely on SRTM data, which is fine for the USA and territories, for the rest of the world the data is only accurate to around 90 metres, which does not result in a realistic landscape in Unreal. Aster data is available from TerrainParty, but often has clouds in the image which need to be touched up in image editing. Also the minimum size is 8Km square and the heightmap image size is too small. There are tools to create landscapes procedurally like Worldmachine, but they are expensive. The best solution I've found is to use a paid addon, Mirage, in Blender.

These are my steps for creating a heightmap in Blender with Mirage, and getting that into Unreal Engine:

But first there seems to be a bug in Mirage with Blender 2.90.1. Mirage does not load  the presets automatically. The presets are in 

C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\addons\mirage\presets
  1. Create terrain in Mirage. I'd suggest Detail: 3. High, though if you PC can handle it, custom 2041 x 2041 will give a similar number of vertices as a 2041 x 2041 resolution in Unreal (for example 256 x 26 components, 64 components, 1 x 1 subsections = 2041 x 2041 resolutions (verts)). I'm not sure how much this changes the heightmap, and need to experiment more.
  2. Play around and get a nice landscape. The Mirage videos on YouTube are helpful, and the documentation is good (find it in the Blender Addons panel for Mirage).
  3. When done, select the Terrain in the Blender viewport
  4. Click on Mirage>Tools>Generate Vertex Groups  and select Generate Height Group. 
  5. Below in Export, click Export Vertex Group to Image.
  6. In the Blender image editor find the image (Height - Vertex Group)
  7. Change the image size to 2041 x 2041 (or whatever the Unreal Engine landscape resolution is. Image>Resize
  8. Save the image. Image>Save As . Set the image to png, BW, 16 Color Depth and no compression.
  9. If you load this into an Unreal Landscape it will be very blocky. First open the image in Photoshop (other image editing software is available and will cause much less damage to your financial well being). Apply a Filter>Guassian Blur at 1.5 pixels. Save the image
  10. In Unreal Engine, select the landscape, go into Modes>Landscape>Sculpt
    1. Right click on Target Layers>Heightmap.
    2. Select Import from File and locate your heightmap.
    3. Once it's loaded you can adjust the height by scaling in Z on the Landscape Transform panel.

You can go back and play more in Blender, save a new heightmap image, apply the Gaussian Blur and then click on Heightmap in Unreal and select Reimport from...