Why do imported heightmaps have an elevation that is not 0?

I have tested exporting height maps from World Creator, World Machine, and Gia all with the same type of results.

When you import the heightmap the landscape that is created is not at the correct Z elevation. Even though the landscape may show it is at 100 in the Z transform if you place an actor on a flat part of the landscape it will have a large negative elevation. Even adjusting the Z transform of the landscape does not change this. The Z scale can change this some, but it is not correct.

In this video I demonstrate how the cube shows a negative elevation while the landscape Z transform is set at 100. The landscape should import at sea level.

How can I reset the landscape, so it is actually at sea level?

In another test this picture demonstrates that on these imported landscapes you can only sculpt down a little because the landscape is imported at close to -255. Unreal evaluates a range of Black and White for height elevation from -255 to 255. The landscape features import correctly but I don’t understand how to get the base elevation correct. As I said before I tested this with 3 professional heightmap generators with the same result.

The cube elevation is at -255. The hole is as much as Unreal would let me sculpt downward. This makes sense with Unreal’s height range 0f -255 to 255. However, there must be a way to put the landscape back at a real elevation of 0. Or a setting to import it at 0. Even if you set the Z transform to 0 or any number on import the resulting real height value is that of the cube or any actor placed on the landscape.

Hi, did you try to also set the z position to what world creator shows you? Cause you just the scale world creator shows you but not the z position.

No I did not, I will give it a try. Thanks.

It does change it from a negative to a positive elevation but it is still way off the mark.

New pics

So the numbers still do not make sense to me.

You set the z-position of your landscape to 147777, not 14777 (like in the image from world creator). So you’re landscape is about 133000 units too high. If you would have used 14777, then you’re cube should be at round about 110.

Silly me. Thank you. This works much better. How come I cannot dig deeper into the landscape then 110? Shouldn’t I be able to dig below sea level? Thanks for your help!

How come I cannot dig deeper into the landscape then 110? Shouldn’t I be able to dig below sea level?

UE stores the landscape as a 16bit greyscale texture. That means you have a fixed number of unique heights you can have (I actually don’t know whether it goes from -2^16 to 2^16 or from 0 to 2^16, so whether you have about 65000 unique values or twice that). By default those values are distributed/used so that you can go from -256 meter to 256 meter, → have a height range of 512 meter.

Now image you want to have a height range of 512 kilometer. Then you would increase the landscapes z scale by a factor of 1000 and now your height range would be from -256 kilometer to 256 kilometer. But since you still have the same number of unique height values, your precision went down by a factor of 1000.

Or if you want to have a height range from 0 meter to 256 meter, then you can decrease your z-scale by a factor of 2 (double your precision) and move the landscape up by 128 meter.

Now the landscape you create in world creator has a certain height range and a certain lowest and highest point. AFAIK when exporting it scales the heightmap in a way that it uses the whole 16 bit range of it (to get maximum precision for that landscape) and then when you import it into unreal you set the z-scale and z-position accordingly. The ‘downside’ of this is that you cannot sculpt anything below the lowest point or above the highest point of your landscape in unreal.

If you need to sculpt lower or higher in unreal, then you could scale your heightmap in some program like gimp and then import that scaled heightmap into unreal (but ofc the larger the height range, the lower the precision). Maybe there is also some way to do it in world creator or unreal but I don’t know about that.

1 Like

This is really good information. Thank you very much!