Make mountains in Blender from height maps

  • Blender Mountain
    Mt Ruapehu modelled in Blender 

Blender can make mountains from height maps, and this is a tutorial to show you how. The height map 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. Download the following height map of two New Zealand mountains, Ruapehu and Ngauruhoe.png, for use in the tutorial.

The height map 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.
Blender is free, and open source, from blender.org. It runs on Windows, Mac, and Linux. This tutorial is for Blender versions 2.5 & 2.6.

Tutorial


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

01 - CTRL ALT U - Add Ons - Import-ExportBlender has an Add-On that can import pictures, and movies. By default it is turned off. So the first thing to do is enable the Add On. Bring up the Blender User Preferences by pressing Ctrl Alt U. Click on Add-Ons, then Import-Export, and scroll down till you find Import Images as Planes. Enable this and close the preferences window.

02 - Check Import images as Planes

Mt Ruapehu and Mt Ngauruhoe DEMNext you will need a heightmap to work with. So download Mt Ruapehu and Mt Ngauruhoe.png. This is an image of two mountains found on a volcanic plataeu 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. At the end of this tutorial you can read about sourcing heightmaps for other parts of the Earth.

03 - File > Import > Images as PlanesOpen your heightmap by clicking File » Import » Images as Planes.
 

04 - Image imported - Press TAB to enter EDIT MODEAfter it is imported you'll see a gray plane in your 3d viewport. This plane has one vertex in each corner. To be able to create our model we need many vertices. The vertices will be pushed upwards by the shaded pixels of the heightmap. We create these by subdividing our plane several times.

Press ⇆ Tab to enter Edit Mode . Press W to bring up the Specials menu and select Subdivide.05 - Press W - Click on SUBDIVIDE

06 - Make Number of Cuts equal 300On the left hand side in the Tools dock you will see a new Subdivide menu. With this you can adjust the Number of Cuts. For this tutorial use 300.
If the number of vertices are fewer than the pixels of the heightmap, Blender will calculate the average change in height. If the number of vertices equals or exceeds the pixels then you may see steps in your model. There are other methods of subdivision, such as using a Multiresolution Modifier.
07 - Click on the Modifiers Icon > Add Modifier > DisplaceIt's now time to apply a deformation modifier to the plane. ⇆ Tab into Object Mode Object Mode. Click on the Modifier icon Modifier in the Properties viewport Properties. Then Add Modifier and from the list choose Displace Displace Modifier.
08 - Choose a textureA set of displacement options will appear. To use the heightmap click on the open existing Texture icon, Texture, and select Ruapehu And Ngauruhoe.
09 - Result of displace modifierN10 - Adjust strength of modifier to .200ow you will see mountains! They'll be rough, and too high though. To correct the height, adjust the displacement Strength, 0.200 is about right for these mountains. If you're using your own heightmap you will want to play with this setting until it looks right. You can go the whole hog and measure between two XY reference points and two Z points to get it absolutely spot on.
11 - Smooth the modelFinally we can smooth the model to make it appear more natural. In the Tool dock click on Smooth.

As an alternative to this, you could use a Smooth Smooth Modifiermodifier. Modifiers are great to use because they allow for non destructive editing. You can play with the settings to your hearts content and easily reverse any changes. Modifiers can slow down your computer a little, if this is so, click Apply once you're happy with the model. Also click apply if you want to edit the model as a mesh.

If you use a rectangular texture you will want to change the Texture Coordinates, in the Displacement modifier, from to . This will prevent your model from looking strange by putting the texture in the right place on the plane.

Was this tutorial useful? Do you have questions? Comment below...

Files: 

Comments

Anonymous

Awesome tutorial! Thank you very much, it works like a charm.
Cheers!

Anonymous

Thank you very much. That is exactly what I was looking for. A simple way to create terrains with Blender. If there was a second tutorial how to texture this terrain would be awesome :)
Thanks.
regards
Thomas

john
john's picture

I'm glad this tutorial is useful. It makes it feel worthwhile writing it, knowing that it is being used.

I'll come up with a texturing tutorial soon.

Anonymous

Awesome dude, cheers ay bro

john
john's picture

Sweet as :)

BTW having a little trouble with applying textures, so don't hold your breath for a texture tutorial.

Anonymous

OMG , this is exactly what i m searching for !!!!
"merci beaucoup" for this tutorial !!!

john
john's picture

De rien :)

Anonymous

nice

Jep

Simply awesome! Thanks

john
john's picture

I've updated this tutorial with:-

john
john's picture

Files: 

3d model of Wellington with a road textureI'm working on a texturing tutorial. I'll show how to texture a map of Wellington, New Zealand. Here's a taster showing the centre lines of roads, click to enlarge.

In the tutorial I'll use textures created from NZ government data, stored at Koordinates.

Attached to this comment is a zip file with the DEM and road texture used in the above model. The DEM is accurate to 1 metre! That's good enough that you can see the roads in the model, even without texturing. You'll need to subdivide the mesh at least 700 times to see this, 1500 subdivisions is better.

john
john's picture

And here's one with a 2004-2005 Orthophoto, also from Koordinates. Click to enlarge.

Wellington with a 2004-2005 Orthophoto Texture

I've attached a scaled copy of the texture. Use it with the model from the previous comment. Right click >> Save Link As...

 

john
john's picture

I've written a tutorial on texturising terrain models using bitmaps, it's at Tutorial: Texturising Terrain in Blender.

Nick Hopton

Hi John, I picked-up the tutorial from your posting on the QGIS forum, but I have a problem.

I've tried importing your sample grey-scale PNG (and one of my own) to Blender but what I get is not a grey plane but a grey cube. This is before I try to move on to the stage of subdividing. It's bound to be something I'm doing wrong, any ideas?

Ubuntu 10.11 (64-bit)
Blender 2.5.8

Though I get the same problem in Win Vista.

john
john's picture

Hi Nick, can you send me the .blend file with the erroneous cube? john&johnflower.org

Nick Hopton

Hi John, well it was me. Under 'Scene' on the RH side of the screen there is an item called 'Cube'. This was enabled by default but disabling it fixed the problem. I'm sorry about this, I don't know anything about Blender (yet) I just pitched straight in with your excellent tutorial.

Regards, Nick.

john
john's picture

Ah! When Blender is first opened there is a cube in the middle of the screen. It has the same XY dimensions as the image youre trying to import. So you will never see the image until the cube is deleted. The quickest way to do this is to Right Click on the cube >> press X >> Enter. To make this empty scene the default when you load Blender, press Ctrl Alt U and click Save As Default. I've updated the tutorial with this instruction.

Michael Mohr

Your data gets me a little closer to completing a difficult task of modelling a WW2 military installation in 3D. Thank you.

john
john's picture

You're welcome. Post some pictures as you progress. It'd be good to see what you're doing.

JoaoTapuia

Very cool, John! Thanks from Brazil.

john
john's picture

Voce e bem vindo, meu amigo.

UNCAHEAD

Thank you for being a constructive force of good in the world! This was perfectly helpful!

gmcquat

Thanks so much! Been looking for something like this for a long time.Kingston, Ontario, Canada

john
john's picture

You're welcome. See also my tutorial Finding Height Maps on the Web. It maybe helpful for modeling terrain in your area of interest.

Anonymous

Fantastic explanation. I have been spinning my wheels looking for this info. Bravo!

john
john's picture

I'm glad it's helpful.

sanjeev yadav

thanku very much i hope there will me more tutorial coming soon..............

john
john's picture

You're welcome, Sanjeev

Sean Gordon

This was very useful to me, thanks.

Anonymous

Thank you very much. It is very useful. I also forward your article on my blog. 

lee

When I import as plane,using png file from this page, I get no plane to show up in view, meaning I have to scale it to see it,,,when I apply the heightmap as per this page and add displace, it looks nothing like yours, as its mostly flat and looks like a version minecraft,,what am I not doing accurately? thxlee 

lee

Ok I resolved my issue, though not sure why I got the behavior I did, maybe that Im using 2.65 ?I had to create a plane by itself, by not using import image as plane, and then go from there by adding a texture, and then displacing it.Sorry about saving 3 posts, but I didn't notice until it was too late, that the message 'it will be posted after approval' shows at top of page.thxlee 

Michael

I followed this tutorial but when adding the modifier (must be in Object Mode) but when going into Edit Mode there is no Map under Texture Coordinates and only in Object Mode does the result happen. Not in Edit Mode so as to 'edit' it. What must be done? I will say your tutorial is great. 

joel

Thankyou!  This tutorial was useful:)  I was able to load my own greyscale image successfully:)

john
john's picture

Hi Lee,

Blender has changed the way it imports images. The tutorial still "works", but the results don't match my example images. In 2.65 image dimensions are handled differently. On the left side bar of the Plane Import, down the bottom, you will see:-

Changing to Absolute or Dots/BU may produce better results.

I will update the tutorial once I've had a play with the new settings. I also suspect the Displace Modifier settings may need to be tweaked too. I will post a comment once I've updated the tutorial.

Regards,
John

 

john
john's picture

Hi Michael,

Look at the Displacement Modifier pane.

To see the displacement in edit mode you will need to click the icon. Clicking this will display theicon which will allow you to edit the vertices in place.

Have I answered your question fully? If not, post further questions.

Regards,
John

Pravin Sashidharan

Excellent tutorial. Exactly what I need to make quick realistic mountainous terrain in Blender. Two observations :1. I use Blender 2.65 and in the Add Modifier (Displace) panel, the Texture Coordinates MUST be set to UV (where yours shows Map) for this to work correctly. This field defaults to Local in Blender 2.65 , which does NOT work.2. After the first step of importing image as plane , the plane imported is tiny by default. This can be scaled up by increasing the X and Y scale numbers in the View Properties panel (N). Obvious in retrospect, but it wasn't immediately obvious to me.Texturing the mountain is next !

Ryan

Hi John Thanks for the great tutorial, it solves what I've been searching for. I am intending to create a model from a greyscale image using this displacement map method. However the file is then to be 3d printed in multiple materials, which is done using the .stl file extension. As I am new to Blender I am wondering if after creating my 'terrain' it would be possible to split up the mesh into different 'parts' according to its original greyscale tones? The reason being that the 3d printer requires each region of different material to be specified within the 'assembly' file.I usually use Solidworks for this process, where each part (for each different material) is modelled seperately then put together in an assemble file for printing, where each part has a reference/connection to one another.Any insight you could possibly give would be much appreciatedRyan

john
john's picture

Pravin, thank you for your pointers. I'll pay attention to them when I upgrade the tutorial.

john
john's picture

Ryan, each shade of gray is a height in the Z axis. Break the model into XY cross sections of a given Z height. Do this using Yorick's Blender Cross Section Script or export from Blender and use Slic3r (an app that prepares models for 3d printing). Remember if you've created a mountain from a plane you will need to close the model by giving it a base so that it is manifold, or thicken the walls so that it can support itself in the real world. You can check for non-manifold edges by entering edit mode, unselecting all vertices, and pressing Ctrl Alt Shift M.

XDude

Hello!I love your tutorial. Especially the screenshots, thanks so much.To me, Blender is the world's least-intuitive program ever. I've tried following the recommended fixes above but am not nearly smart enough to know where all the icons and sub-menus are. Do you have any idea when you might be able to update this tutorial?Thanks again. :)

Iulian

Excelent tutorial, thanks John. Saved a lot of research for me.

john
john's picture

If you're having trouble following the tutorial because I haven't updated it. Perhaps try downloading an older version of Blender from http://download.blender.org/release/Blender2.59/

Chris

Hey John, thanks much for this simple and effective tutorial.  I've followed a bunch of other tutorials usually in video and most times, it's difficult to keep up with the author.  I used the latest version of Blender, v.2.68 and everything you've stated to do worked just fine.  There's nothing worse than going through a tutorial that features an older version of Blender where a lot of the tools aren't accessed the same way as in a later version.  I'm a web developer by profession, but have a heavy interest in 3D graphics.  It's doing stuff like this that gets my head out of code and programming.  Thanks again, brother.

Justin

Great tutorial. I am also trying to 3d print these files but cant figure out blender. could you point me in the direction of a basic tutorial so i can make a box underneath the mountain so slicer is happy?

Justin

Great tutorial.  But i am really new to blender and was wondering how to make this mountain into something you can run through Slicer and print.  I think it wants a bottom.

john
john's picture

Justin:-

  1. TAB into edit mode.
  2. Press E (to extrude) and drag down as far as you need, LMB to confirm extrusion.
  3. Press S (to scale), Z to lock scale to Z axis, 0 to scale to 0%, and ENTER to confirm.

Good luck! :)

Nick

Great tutorial. Very helpful easy to understand and direct to the point.  

Eduardo

Thank you very much, my friend! really excellent job, clear, easy to learn and very detailed...it help me a lot!

john
john's picture

Justin (from the comment above) used the tutorial to print a 3d model of Mount Athebasca:-

Ray

Thank-you for taking the time to write this tutorial.It was very helpful and worked just as you said that it would.Keep up the good work!   

Justin

Hey John!   You have been a great help so far but i found one thing odd when I do this for multiple sections of mountains.   When i try to line up adjacent sections of data the edges dont line up.  I have figured out that when I displace the model only shows the middle of the PNG that i made.   If I change the displacement to be UV in the modifiers menu it does the whole image.  This shows any white space on the edge to be the top height and if I'm trying to line of up section they don't end up exactly the right size unless i send a long time in QGIS composer trying to match up the image to be exactly centered.  Is there a better way to make the chunks the same size while in blender?  I am trying to 3d print each piece of data then put them together for a large area of mountains.

john
john's picture

I suggest stitching your heightmaps in QGIS. Add each one using the Add Raster Layer icon . Then when you export using composer, or screenshot, you will have a seamless texture to work with in Blender. Where do you get your data from? Can they provide it in tiles that can be stitched in QGIS, like below?

elisa

John, I'm an archaeologist, I can't even draw a rectangle in Blender (seriously...), but I could easily follow your tutorial! So really THANK YOU, you saved my work!! and thanks Pravin for your comment too! Guys, if you ever come to Venice a dinner is on me! :)

john
john's picture

You're welcome, Elisa. If you have any questions, do ask. Are you using Blender for an archaelogical project?

Pravin

Hi Elisa ,I'm glad my comment helped. Sadly, I haven't had time to focus on Blender for a while. Maybe this will inspire me to get back into Blender again. Regards.

elisa

Yep, it's an archaeological GIS project. The 3d model will be a visualisation of the region we are studying, I'll try (if I can...) to apply a geological map to it. There is one thing I don't understand tho, my project is an analysis of the distribution of the sites relatively to altitude and slope morphology, so I really need the elevation to be accurate. How can I reproduce the "real" height of the mountains? Do I have to set the strength to a specific value?

john
john's picture

Hi Elisa,

You'll get greater accuracy by changing the dimensions in the Properties (N to hide/show) panel:-

Make X and Y the area of your terrain, and Z the distance between the lowest point and the highest point. It is possible to have Blender use Metric or Imperial units if you prefer (but not necessary). In the Properties viewport , Scene tab (on the right side of the screen):-

-> 

Have you looked at my post on applying textures to terrain? See Texturising Terrain in Blender.

 

john
john's picture

Pravin, I've updated my tutorial with your tip about switching from Local (Map) to UV. In Blender 2.68+ this is only necessary when the texture is rectangular instead of square. Does this match your experience?

Poio

Short, precise, simple, efficient.Very nice tutorial ! Thanks a lot.

Pie Lord

Thanks a lot, yo! This helped a lot with a school project I made. Pretty easy, compared to other tutorials I've made sad little attempts at. :D 

Pie Lord

Oh, but is it possible to make it so that the bottem of the map is still full and rectangular instead of having the entire thing, top and bottem, all curvy? I plan to 3d print mine out, and so it would be bad to have a non-flat bottem.

john
john's picture

Pie Lord, glad the tutorial was helpful. Check through the comments above and you'll see my instructions to do exactly that.... and some photos of someone who used them to print out their map.

precast3d

Thank you so much John for this tutorial. It worked perfect with Blender v2.70. I plan on using this method for turning photos into a mesh to be 3D printed. I may have a some questions but would love to display what I 3D print. Stay tuned : )

john
john's picture

It'd be neat to see your prints. Do ask questions.

Bruno

Very straightforward tutorial.Do you know how to do the opposite? That is, generating a grayscale heightmap from a surface on Blender.Any suggestion will be very appreciated!

john
john's picture

Files: 

Hi Bruno,

Try http://blog.nalates.net/2011/10/10/blender-2-5-exporting-height-maps-tut...

I used it to make to the one in the image below for use as a stereogram. But if you follow that tutorial it will suit your purpose. Do write back and let me know how you got on.

I've attached the .blend.

Add new comment