Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity Import PNG Heightmap

Discussion in 'Editor & General Support' started by Spyter, Jul 13, 2014.

  1. Spyter

    Spyter

    Joined:
    May 15, 2013
    Posts:
    2
    I am new to unity and I wanted to import an existing height map I found on the web to give me some base terrain to practice on but I cannot get it to work. I have tried everything I can think of and I am at a complete loss. I've tried saving the file as a bmp and jpeg as well with no luck.

    Below is the image I am trying to use (2048x2048):
    http://www.xtr1m.com/temp/heightmap.png

    Under resolution my terrain width and height are both the default 2000. When I choose "import raw" I am setting it to the following:

    depth: bit16
    width: 513 (I have tried 2049 and 1025)
    height: 513 (I have tried 2049 and 1025)
    byte order: windows

    Since the image is 2048x2048, am I using the wrong import height/width? I read online that the height/width needs to be divisible by 2 and you need to +1 to it.

    Does anyone happen to know what I am doing wrong?

    Thanks in advance, any advice would be greatly appreciated!
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    No, it needs to be power of two plus one.

    It can only be in raw format.

    --Eric
     
    Spyter likes this.
  3. Spyter

    Spyter

    Joined:
    May 15, 2013
    Posts:
    2

    Thank you Eric for clearing all that up for me! I really appreciate it!! :)