First this is naming. ‘inverted heightmap’ is really a symptom. What’s a better name ‘Image Terrain origin conflict’? Suggestions welcome.
Image are stored in files, starting at the top left. Each row is store from left to right, then repeating for each row DOWN the image.
missing image 2 - new user limit
Terrains are stored in structures started at the bottom left (at the feet of a viewer, standing at the origin and looking north). Each row is store from left to right, then repeating for each row UP (into the North/+Z) the terrain.
The symptom happen when Image data is naively copied (start to end) in the Terrain structure. Distance North (top) ends up at the viewers feet, and South (bottom) ends up in the distant North.
missing image 3 - new user limit
This screenshot shows what I mean. I created a flat terrain, then sculpted the origin corner (bottom left/south west) with a ‘hill’. I then exported the terrain to a heightmap. The ‘hill’ in the heightmap ended up in the origin corner (top left/north west). The ‘hill’ moved from south west in the terrain to north west in the human readable image. A problem.
How to fix?
1/ Fix the naive coping of data between images and terrains
2/ Add the ability for the user chose between naive and corrected coping (Unity does this).
missing image 4 - new user limit
Both solution have pro and cons.