Why are heightmaps importing stretched?

i exported a heightmap at 483m tall but now when imported to world machine its very stretched out, my project height is 2650 but when i set it to 483 its TOO flat, so something must be wrong with the numbers, can someone help?

1 Like

When you export a heightfield, remember that it doesn’t have any intrinsic scale associated with it - it’s just a set of pixel values. Assigning and keeping a consistent scale is thus, unfortunately, your job.

The “Highest Elevation” set in project settings represents the maximum value that can be produced in the image file, and the height value in meters reported in WM are scaled by this so that the values can be contained by the image file.

The easiest workflow is to make sure you’re importing into a project with the same ‘Highest Elevation’ possible. If this is the case and you export a file, and then use a File Input to load it again, you will get back the same exact result so long as the file input’s ‘Elevation : Scaling Type’ is set to “Natural file elevations”. This takes the image values and scale them by the project vertical scale, and use that as the value.

There are lots of other possible ways to deal with this scale-less property of heightfields, and in particular if you are interoperating with other software or engines, you may need to scale things specifically. That’s what the other file input scaling modes are for, which specifically place an image such that its highest and lowest value are the provided elevation span.

Also keep in mind that something being “steep” or “flat” is also a property of how large it is in plan-scale (XY), not just its elevation (Z).

So things to check:

  • What were the render extents when you exported? How large XY, and how large Z?
  • What are your render extents on import? They should be the same as above to work without further effort. Use ‘natural file elevations’ for this happy case.
2 Likes

In addition to everything @Stephen said so far:

This kind of stretching could also be due to baked colorspace other than “Linear” within that heightmap png.

If you exported this landscape from somewhere, re-export with a 16bit TIFF or EXR file type, with linear gamma.

If you downloaded this file from the web, add a “gamma” node after that file input. Set it to “Remove sRGB Gamma”. That should fix the problem (if it’s indeed the problem that I suspect).

Hope this helps!

1 Like