Search Unity

How to Import Real World Map with Height Map in Unity 3D.

Discussion in 'World Building' started by RehmatKhan, Apr 22, 2019.

  1. RehmatKhan

    RehmatKhan

    Joined:
    Jul 1, 2018
    Posts:
    3
    Hello,
    I am working on traffic simulation in unity 3d. I have simulated Straight Roads and U-turns but now I want to simulate using real world map like a city in my country (Pakistan) or any other country.

    My question is how can I import real world map to unity 3d with its height map (Get road data from OSM maybe) I need height Map because if there is some kind of flyover or highway the terrain should have that height at that position.
    I know there are different tools to do it Like ArcGis etc but I don't know how to use them and combine it with unity 3d. I have no prior knowledge of ArcGis or any other geographical software.

    I need you guys to help me here. someone who have done such thing before or know how to do it.
    If you guys know how to combine ArcGis and Unity 3d so do share the complete explanation or link to the article or tutorial.
    For the reference to what I want you can think of Vissim traffic simulator.
     
    Last edited: May 7, 2019
  2. AmandaF

    AmandaF

    Joined:
    Dec 4, 2015
    Posts:
    3
    Good morning friend,

    There are a lot of tools out there that can pull this data, but the ones that do all the work for you will cost some cash.
    If you need something free, then you'll have to put in some of your own artistic elbow grease.

    Here's something you can try, but take note that it only works with Unity 2018.3.x (new Terrain Tools are needed)

    1. Go to http://terrain.party/ . This map tool will let you pick up to an 60km set of terrain and export out a series of Height Maps.
    2. If you are picking somewhere in the US, I recommend you click the far right-blue "Square" icon and select USGS data - You get more of it and it looks crisper.
    3. Outside of the US, you have to use Open Data (default option).
    4. After picking your area, click the Download Cloud icon key, name this data, and it will download a zip file. (Note: On rare occasion, terrain.party will go down. If this happens, the you just have to wait until they come back)
    5. Pick your favorite error free heightmap (Merged is usually good). Then drag and drop that Height Map into your Unity project.
    6. Create a new terrain.
    7. Go to "Stamp Terrain" tool.
    8. Create a New Brush using your height map you just imported to your project.
    9. Play with your opacity, brush size, and Add Height features.
    10. Stamp your terrain into Unity.
    After that, you'll still need to color it. It will also take experimentation to see what terrains work best and were.
    Use your fall off tools to create custom landmark features- Example you can pull JUST a mountain range and "stamp" that to various areas of your terrain.
    You'll still need to color it too.

    Good luck and happy world building!
     
  3. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,664
    Apart from terrain.party (which has the habit of not working correctly sometimes), there is also Tangram Heightmapper.
    However, it doesn't have the ability to search for a location and the exported heightmap won't be square.
     
  4. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    681
  5. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,254
  6. RehmatKhan

    RehmatKhan

    Joined:
    Jul 1, 2018
    Posts:
    3
    Thank you @AmandaF for your help, it is quite detailed explanation and I very much appreciate it. But I've already tried terrain.party. The heightmap i got was not upto the mark and had some false heights.
     
  7. RehmatKhan

    RehmatKhan

    Joined:
    Jul 1, 2018
    Posts:
    3
    @CityGen3D gone through your work. It is very admirable. A perfect tool for my work. But for a time being I am looking for some free alternatives. I am willing to work on 3rd party Applications myself but cannot afford something like this for a moment.
    Thank You for your Help.
     
    CityGen3D likes this.
  8. FazeFew

    FazeFew

    Joined:
    Jan 2, 2020
    Posts:
    3
    Does this still work as of right now?
     
  9. justinsykes2006

    justinsykes2006

    Joined:
    Mar 12, 2020
    Posts:
    10
    Yup it does. I used the Tangram Heightmapper instead, because the other one didn't have the normal map data. But it definitely takes some researching to get the exact right settings on the brush tool to make sure it's as accurate as possible.