Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Terrain Toolbox import heightmap resolution errors

Discussion in 'World Building' started by JBT27, Sep 30, 2019.

  1. JBT27


    Jul 13, 2016
    Tiles imported into the Import Heightmap dialog, and the Tiles section, report:

    TerrainToolbox: Imported heightmap resolution is not power of two.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Well, it is actually. The menu options are not powers of two, they are powers of two plus one. I have tried tiles that are 2048 and 2049, but it throws this error every time. This on a 10km x 10km terrain.

    Or would be if it worked.
    Cuku_ likes this.
  2. Skull_Frog


    Jul 18, 2017
    I'm having the same issue, any updates?
  3. sky-diver


    Jun 25, 2019
    Same thing here - Any chance to get that get solved ...?
  4. cucoogames


    Mar 24, 2020
    +1 here and bumpedi-bump.

    I've tried different images with the resolutions 1024 and 1025 as well as 2048 and 2049, but it won't let me import them with the error given by OT.
  5. danramosf


    Sep 28, 2018
    So nobody was able to solve it?
  6. madfu


    Aug 9, 2018
    Got this to work, pretty easily by following the info in the docs explicitly.

    That 'pretty easily' came at a price: multiple hours, over a couple of days of trial and error, including having a look at the underlying scripts. Unity really needs some better documentation for this tool.

    In my case, i was converting a terrain i'd made in Second Life years ago into a heightmap that was compatible with Unity. Here are my steps at a high-level; one shouldn't need to follow all of them.
    1. in a tool like GIMP (or other image manipulation tool) import your image in its native format.
    2. the Terrain Tool has changed its behavior a bit in this update to specify that your heightmap must be a power of 2, therefore, in your image manipulation tool make sure the RESOLUTION, NOT THE SIZE is a power of 2 (128x128, 256x256...etc). This is going to seem strange if you have used this tool in the past, where you manually had to change your heightmaps to 257x257, but this is no longer necessary, as Terrain Tool now does this for you during the process of import.
    3. ensure that your Precision or bit depth is 8-bit or 16-bit, floating point, with Perceptual Gamma sRGB. i tried both.
    4. DELETE (not just disable) all layers except the one containing your heightmap. this is only necessary for those with multiple layers in their heightmaps, as with Second Life heightmaps. i wouldn't expect this step to be necessary for normal heightmaps, but i burned several hours not groking that disable still leaves the data available in the final file (thank the Maker for Hex Fiend).
    5. export your new heightmap to .raw. if this step is completed correctly, a 256x256 px/in resolution of an image of 256x256 pixels will yield a file size of ~66KB (on a Mac).
    6. import your new heightmap into Terrain Tool like normal, making sure that your Tile Height Resolution matches your power of 2 compatible resolution +1 (257 for 256x256).
    following these steps i was able to convert a dozen or so heightmaps in about an hour, once i'd figured it out.
    Last edited: Oct 10, 2020
    DavidLTP and mirekcolakov like this.