I’m looking to use UE4 to recreate real-life areas at a 1:1 scale using highly accurate height maps. Because of this, is it possible to get the details on the measurement system used for the height maps and terrain? I’ve managed to successfully import a height map but the issue is the Z scale as it has left the terrain looking “squashed”.
Some further explanation of this section would be great:
"The heightmap image values are treated as unsigned numbers. A height image value of 32768 is at the same Z coordinate as the Actor, lower values are below, and higher values are above.
These values are divided by 128 internally, and then multiplied by the Landscape’s Z scale (default 256). This means that by default, a value of 32769 (i.e. +1) is 2 units (cm) above the Actor location, and the maximum range of heights is -655.36m to +655.34m."
Well, assuming that the quoted information is correct, and that your heightmap is equalized/normalized in such a way that the maximum height corresponds to fully white pixels and the minimum height corresponds to fully black pixels, you could simply calculate the final landscape Z scale by dividing the range by 512.
So, range = distance between your highest and lowest point in centimeters, and Z-scale = range/512.
For example, if your white point is at 100 meters, and your black point at -100 meters, that gives you a range of 20000 centimeters. Dividing that by 512 gives 39.0625, which would be the landscape Z-scale required to produce that exact range.
I ran into a similar issue before and I used basically the same maths to scale my heightmap correctly - though I’m sure I used a value of 256 rather than 512.
512 might be specific to the example of having ± 100m from the origin. If that is the reasoning, I didn’t run into this issue as my origin was at sea level so my range didn’t enter a negative value.