All Heightmaps Import with Odd Edges

Hi all,

I’ve been importing heightmaps from different sources, all of which are converted to the RAW format by ImageMagick.

In every image I import, there is an edge attached to it (in screenshot). I import the image heightmap with the same height and width dimensions as the raster being imported, and use the height as a X size of the terrain and the width as the Z size of the terrain (in screenshot for an 1275 x 258 image).

Many thanks for any ideas on how to move forward!


2916699--215215--Screen Shot 2017-01-11 at 11.06.56 AM.png

Unity’s terrain only supports heightmap resolutions that are power of two plus one (e.g. 512 + 1 = 513). If you try to import a raw heightmap of arbitrary size, the heightmap resolution is set to the next bigger pot+1 and the edges are stretched to fill that resolution.

If you really need to import non-pot heightmaps, you should scale them to pot+1 in ImageMagick, but keep using those asymmetric numbers for terrain scale (though this will give you an uneven distribution of resolution between the xz-axes).