Make Mountains in Blender from Heightmaps

Last modified

1 March 2021
Mt Ruapehu and Mt Ngauruhoe model from SH1

Introduction

Blender can make mountains from heightmaps, and this is a tutorial to show you how. The heightmap I've used is represented by a grayscale bitmap. Black being the lowest point, white the highest. Blender is able to deform a mesh based on the pixel colour of a texture.

This tutorial is for Blender versions 2.5 through to 2.79b.

Open Blender

When Blender is first opened there is a cube in the middle of the screen. To delete this, Right Click RMB on the cube >> X >> ENTER.

Mt Ruapehu and Mt Ngauruhoe model from north
Mt Ruapehu and Rangipo Desert

Looking at Mt Ruapehu past the Rangipo Desert from State Highway 1.

Download a Heightmap

You will need a heightmap to work with. Download Mt Ruapehu and Mt Ngauruhoe Heightmap.png. These are two mountains found on a volcanic plateau in the North Island of New Zealand. You can make your own heightmaps by opening your favourite photo editor or painting program and using a grayscale palette to draw high areas in lighter shades and low areas with darker shades.

The heightmap was created by University of Otago - National School of Surveying who have published it at Koordinates, and is released under a Creative Commons Attribution-Share Alike 3.0 license.

Mt Ruapehu and Mt Ngauruhoe Heightmap

Add a Grid

Add a mesh grid with 513 subdivisions by:-

  1. Move your mouse pointer into the 3d viewport.
  2. SHIFT A will bring up a menu.
  3. Select Grid.
  4. In the Toolshelf, bottom left of the window, set the X & Y subdivisions to 513.

02 Subdivide Grid

01 Construct a grid Mesh
03 Add New texture

Import the Heightmap

Click on the Texture Icon Texture icon in the Properties Icon Properties viewport.

Click on the New button.
New Texture Button

Click the Open button under Image and navigate your filesystem to find your heightmap.
Open texture

Scroll down and change the image mapping from Repeat to Extend. This will prevent artifacts occurring at the edge of the model.
05 Extend Image Mapping

Displace the Grid

Click on the Modifier Icon Modifiers icon in the Properties Icon Properties viewport and add a Displace Modifier Icon Displace modifier.

Click on the modifier's texture icon and select the heightmap.
07 Choose Texture

06 Add Displace Modifier
08 Initial Displacement Result

Initial displacement result.

09 Midlevel and Strength Values

Change the Midlevel value to 0 and the Strength to .135.

Changing the midlevel moves the model up so the bottom is on the grid in the viewport. The strength corrects the height of the terrain. For other heightmaps a different strength value may be needed.

Below is proof of accuracy. The height of Mt Ruapehu is 2797m, Mt Ngauruhoe is 2287m, and the distance between them is 15,825m. A red box shows these distances below:-

Proof of Scale for Mt Ruapehu and Mt Ngauruhoe

Proof of scale.

Improve the Quality

The model is coarse. We can bring out more detail by subdividing the mesh further. Subdivision can slow your computer so we will tell Blender to display a low level when working on the model and then change to high at render time.

Add the Subdivision Surface Modifier Icon Subdivision Surface modifier.
10a Subdivision Surface Modifier

It will appear below the Displace modifier. We need to move it to the top of the stack so that it is applied first. Click the 10b Modifier Up up arrow button.

Change the subdivision method to Simple.
10c Subdivision Method
 

Change the level of subdivision for View. 3 is optimal, but if your computer becomes sluggish, or crashes, then leave it as 1. Render at 3.
10d Number of Subdivisions

10e Modifier Stack
Mt Ruapehu

Closeup of the model.

12 Smooth Shading

Smooth the Model

Looking closely at the terrain you will see it is made up of 'squares'. We can improve this by selecting the Smooth shader from the Toolshelf on the left of the window.

13 Smoothed Mountains

The smoothed model at the 3rd level of subdivision.

Discussion

Arthur
Omg, dude, pretty perfect job, thx u so much
John Flower

You’re welcome.

Yiwei
This is awesome! So glad you shared it. THX :-D
John Flower

You're welcome.

Robert
perfect! nice and easy...it works perfectly!
John Flower

You're welcome.

Paige Winkle
Thanks so much! time to CNC some mountains!
John Flower

It'd be interesting to see your results, Paige.

Romanens
Great job!
Keon T White
Thank you!!! I will send the students creations.
Topcat
Thx. Really appreciate this.
Ian
Can we overlay Google satellite image?
John Flower

Ian, yes it is possible to overlay Google satellite images. I'll keep this topic in mind for a future tutorial.

Andrew
Many thanks for your tutorial and it's helped me to create a good 3d model of Crater Lake in Oregon which I hope to export to Unity3d and add low poly tree's etc. Everything just looks shiny though so I was hoping you could point me in the right direction to assign a satellite image material over the top please? I've tried many ways but the issue seems to be with the already used heightmap clashing with anything new I add. Is there a way to export the model just as one solid piece so that the heightmap is permanent assigned then I can re import in either Blender or Unity3d and add a new material to it? Look forward to any help if you have the time. Thanks.
John Flower

Andrew, send me a copy of your Crater Lake model, along with the satellite image.

Ensure the heightmap is included by :-

Andrew
Thanks for that John. I sent a dropbox link via my regular email address.
Olga
Hi! I was wondering if you know of a way to add a flat base to the mountains? Something like extruding the surface down and then flattening the bottom, is this possible?
Stella
Hi, I am interested in how you arrived at the strength=0.135 in the displace menu and the subdivision of the grid=513. Really appreciated your work.
Dang Tuan Hoang
Hi John, can you make a tutorial about extracting height map from 3D models from a specific plane? Thanks for the great tutorial!
John Flower

Stella,

The strength of displacement was arrived at by trial and error. I noted the height of two mountain peaks and the distance between them and created a box of that size:-

The heightmap is 2048 pixels square. My computer is too slow to handle 2049 subdivisions (2048+1). So 513 is a quarter of 2048 pixels + 1... I'm open to my arithmetic being wrong.

I hope you're able to create something useful from my tutorial.

 

John Flower

Dang,

I'll keep your request in mind for a future tutorial. In the meantime adapting my tutorial on Colour by Altitude would create a height map. You'd need to rotate your model so that the desired plane is parallel to the XY plane.

http://johnflower.org/tutorial/colour-altitude

You'd end up with a node setup as below (follow tutorial to achieve this):-

Dang Tuan Hoang
Thank for the quick response John. Do you think it is possible to replicate a 3D model which exact same scale if I extract height map by following your Colour by Altitude tutorial, then recreate the model, using method mentioned in this tutorial? I'm trying to create a pipeline to encode and decode 3D models.
John Flower

It'll be a matter of adjusting the displacement strength by the Z height of the source object.

john a bisson, md
Can I use a geoTIFF for a height map?
Petes
Thanks, worked great but the only problem I have is that all is inverted, the mountains are holes, how can I fix that other than inverting the colors on my height map?
David
great tut but it crashes on render. Not sure why. I can render a simple cube, 16Gb of ram and watching Task Manager I never get up to 16Gigs before the crash so it's not a resources issue.
John Flower

David, can you email the file you're trying to render?

Craig
This is awesome, thanks for this. I am trying to render a landscape a friend sent me, but it doesn't have the same level of depth. As in the tall mountains are fine, but the lower mountains are really shallow, as if the top have is at the correct strength, but the bottom half isn't. Thoughts?
John Flower

Craig, can you email me your source file?

Michael J
Cheers John, I'm planning to make some abstract patterns using this technique and follow that up with some other deformations to create some CNC-milled works.
Alison Souza
Is there a reliable way to define the strength of the displacement modifier? You did it by trial and error. Me too, but this doesn't feel right.

Add a remark

Your email will be private. It is used to notify you of replies to your remark.

Plain text

  • No HTML tags allowed.