Heightmap DTM Landscape Formats

We deal with a lot of real world scenes that come from globalmapper and world machine. I find the RAW format is cumbersome and has too many options, and doesnt specify real elevation data, only greyscale. I would really like to see support for something like TER (terragen height grid format) or BT (Binary Terrain Format), that contain real world height values. BT also contains some geolocation information.

Why not model everything yourself in Mudbox or Zbrush and then import it into world machine add some effects and export it into UE4, that is only 1 method I can think of getting close to the real thing.

Out of interest: Why would you need real elevation data? Don’t you get correct scales using the greyscale maps?

Our data comes from real world satellite survey heightmaps, so for our projects all height need to be accurate in z to around 0.5m, so no Mudbox or Zbrush is not the solution. The reason we need real elevation data is that we are making railways, road projects and city planning. Greyscale maps dont contain real elevation data, they only contain 65,536 shades of grey. The problem is that there is no correlation between the shades of grey and their real world heights. If the total height between white and black are known then its possible that it could be scaled somehow. But UE4 doesnt even seem to have a min and max value that can be entered, so im guessing that scaling is the only way. Weirdly enough UE4 wont even accept unity raw 16bit images, so thats a good example of why RAW is an overly complex format.

What you guys are trying to do is quite complex of task lol, well I am not a expert in those type of fields maybe ask on Answerhub if you haven’t already.

You can do this in a 3rd party application like GeoControl.

Should actually work and has for me. Though you need to look out for the size of terrain. What kind of error are you getting?

Yes, scaling is the only way to get DEM data into UE4. And its a little cumbersome, because you have to divide the raw vaules by 128, and the middle of the range is put at the actor’s location, so you have to transform it upwards if you really want to have your terrain to go from 0 to max height in UE coordinates. But the RAW format is actually the simplest of all (at least the one that Word Machine exports): It’s nothing but the elevation data, no meta information or anything.

You probably will get a lower accuracy out of satellite data than 0.5m. First of all the vertical mean deviation e.g. for SRTM data is usually higher than that. Also, in the interpolated regions (non-US SRTM data has around 90m resolution in the horizontal) you will most certainly have a higher error.

Out of interest: How large are the terrains that you put into a UE4 scene? Do you use standard level streaming or some custom mechanism?

Hi Rastar, Ill try that with the RAW format. The data we use is a mix of CAD contours, SRTM, photogrammetry, so generally accuracy varies quite a bit, starting at around 100 to 500 mm for the contours. We take it into Global mapper and merge it together.

We also use Unigine which can deal with very large terrains. Im in the process of seeing how big we can make terrains in UE4 using Landscape tiles. Ideally i would like to get 25 x 25 km terrains working. I havent looked into the data streaming yet, but have looked into problems that arise from not having double precision. At about 15km for the origin the editor camera jitters around a little bit, but its not too bad. We may need to move toward a camera centric world approach or a tile based sector approach to keep the camera near the origin.

Hi voltaire, thanks for the info! I wasn’t aware of additional data that you can use to increase accuracy, apart from the German X-SAR data that is more precise than SRTM, but only has 40% global coverage. Do you have a link to the contour and photogrammetry data that you’re using (if publicly available, that is)?

Unigine is supposedly very well featured for rendering large outdoor scenes, so what brought you over to UE4?

I myself are targeting areas of about 200x200km, but only about 10x10km will usually be visible at a time, so level streaming etc. should work well. There is an experimental feature in UE4 called World Browser (you have to enable it under Editor Preferences->Experimental) that allows you to set up large (tiled) worlds and takes care of resetting the camera to the origin as well as streaming. Haven’t used it up to now (will be over the next couple of days, though), but it sounds like a good fit.

This thread is exactly what I was looking for. I also use Global mapper and am looking at scenes about 50x50km. Using 30m ASTER2 data, 2m Lidar, and also seismic interp grids done by geologists, which can be 25m to 200m spacing. So far the best results I’ve gotten have come from 24bit Tiff exports from Global Mapper, then converting to greyscale 16bit in Photoshop and saving as RAW. Still the Z values aren’t accurate, and depend on the height range of your scene. Have no idea how to determine a 1:1 ratio on height. Also I’m having trouble figuring out how to drape satellite or aerial photography onto the scene. I know it has to do with the ‘TextureCoordinate’ value but, 0,0 on the tiling values gives me one constant colour, 0.001 gives me close to a 1:1 mapping, but I don’t know how to map the texture perfectly, which is necessary. Then want to create normal maps to improve the overall quality of the scene.

Also it is +/- 7m accuracy with SRTM 90m and +/- 14m for SRTM 30m, or something close to that. LIDAR is something else, much more accurate.

Just a note on how I do the scaling:

Let’s assume you have 2x2 tiles with a resolution of 2012x2017. each tile is supposed to cover 4x4 km, with a height range of 0-2000m. Then:

  1. Horizontal scale (x and y) for every tile is 400000 / 2017 =198.314.

  2. For vertical scale, UE4 divides the z vales (0 to 65535 for a 16bit raw) by 128 and puts the middle of the range at the origin of the landscape actor. Therefore, a z scale of 200000 / 65535 * 128 = 390.631 will give you the required height range, but going from -1000 to 1000.

  3. So you’ll also have to move the landscape upwards by 100000 in the z direction to have it go from 0 to 2000m.

For the texturing, you can use a Landscape Coords node in your material. You will have to set its mapping scale to the tile resolution (e.g. 2017).

This is a non-warranty advice, I just have started fumbling around with UE4 terrains…

1 Like

Thanks for the advise Raster. You’ve clearly got a good grasp on this. Just out of curiosity, you don’t work for Aerometrix do you? Just cause you sound familiar to other threads I’ve read from them. Also, I assume you’ve used Terrgaen? If so, how to you feel about UE4 compared to Terragen? I see UE4 as potentially a way of drastically reducing render times. Cheers.

Hi Tarrant, no, I’m actually just doing this as a hobby right now. I ain’t currently using Terragen, I only use World Machine to process and “enhance” my DEM data.

There is a good discussion on exporting geyscale DEMs from Global mapper here: http://www.globalmapperforum.com/forums/elevation-data/8977-16-bit-elevation-dtm-photoshop.html

From the sounds of it you really have to be a science wise at Math to be able to figure out how to import actual real world terrain data. I have used Unity and it is so extremely easy to import real world terrain using the actual height. I would really love to design my own game using UE4 but it sounds as if they never even really thought of this when they designed this engine. Again I am not mathematician so everything you are saying is just garble…lol

I might be forced to just use Unity because I am using real world 1 meter lidar data with global mapper. I have exported out to Geotiff, BT and other formats to photoshop RAW to import into unity. I will not accept non real world data and just use brushes and paint my own elevations. I have access to real world data so why would you not use it? By the way it would be used for game design. Maybe the guys at UE4 could do a video on this and put it on there youtube channel? 4x4,2x2, 16x16 it’s just not coming into my head very easy even reading through it.