Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by abdullah.ahmed · Oct 31, 2009 at 05:13 AM · terraingraphicsimportheightmap

Issue with importing raw heightmaps (made in photoshop)

I just want to make some temporary terrain and for that purpose I go in photoshop, create a new 1024x1024 16bit, greyscale image. I then render clouds, do some manipulation on it and save it as a raw file (macintosh format).

When I import heightmap in unity using the raw file above it imports almost fine except there are always jagged edges (as tall as the max height of the terrain) on two of the edges of the terrain.

Here is a screenshot of what happens...

http://www.screencast.com/users/Abdullah.Ahmed/folders/Jing/media/f8a422f9-2851-45d4-8223-254db6b886c2

Any idea what I can do to stop this from happening? It is terribly timeconsuming to flatten those areas out using the flatten height tool. Is there some other way of fixing it?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
7
Best Answer

Answer by aaron parr · Nov 01, 2009 at 03:48 PM

The resolution of your heightmap needs to match that of the "Heightmap Resolution" field. Your screenshot shows a heightmap resolution of 2049, and yet you are supplying a 1024x1024 heightmap. You can fix this in a couple ways:

  1. create a 2049x2049 heightmap and import it
  2. change the heightmap resolution to 1025, and resize your heightmap to 1025x1025.

Optimally you would first set this resolution when you create the terrain asset in Unity, second, create a heightmap with the correct resolution, and third, import the heightmap.

Also, the heightma resolution clamps to specific sizes. You can not set it to 1024. If you enter that number into the field it will result in 1025. Resolutions of heightmaps follow the classic pattern of x+1, where x is a doubling number following this pattern: 2, 4, 8 etc... So heightmap resolutions are numbers like 257, 513, ,1025, 2049.

For an in depth explanation of Terrain Assets see the reference section of the documentation: http://unity3d.com/support/documentation/Components/terrain-UsingTerrains.html

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image abdullah.ahmed · Nov 01, 2009 at 04:14 PM 0
Share

Thanks. I figured out that I need to make sure the heightmaps I am making are x+1 width and height in pixels as you mentioned above and that solves the issue.

avatar image
2

Answer by zumwalt · Dec 04, 2009 at 10:45 PM

You want to see something really cool, open Photoshop (any flavor) create a height map /map, click file, save as, choose RAW, save the file, make sure you put a solid white number 1 in the upper left of the map image so that it stands out on the terrain, also make sure that when you do this save, you choose Non-interleaved order, otherwise the map is all screwy on import, see on Photoshop CS4 and even Photoshop 7, File Type is greyed out as PRAW and File Creator if greyed out as 8BIM, header is set to 0 by default. Ok, now in Unity, create a new blank terrain and import height map, choose the RAW exported file and apply it, you will now see that the terrain is horizontally flipped, verticaly flipped, and inverted, so Unity is improperly importing RAW heightmaps, you have to flip the item in Photoshop horizontally, the flip it vertically then import it into Unity, otherwise you will not be able to import it at all and have it correct.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image majmun · Oct 27, 2020 at 12:25 PM 0
Share

my problem also was because of bad exporting from photoshop. Your detailed answer really helped me!

avatar image
1

Answer by MSylvia · Oct 31, 2009 at 09:26 PM

Some of your numbers don't match up. The terrain resolution is 2000x2000 with a height map resolution of 2049. Your texture is only 1024x1024. How wide is the area of the error? It could be because the resolution of the height map is 2049 instead of 2000 or the resolution of the terrain has to match the texture.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by JoeW · Feb 01, 2010 at 09:44 PM

If you're getting a "lip" on your terrain, what might fix it is to switch your Byte Order (in your RAW export dialog in Photoshop) from Mac to Windows - and do the same when importing your map. I've found that using Mac byte order will give you that annoying "lip"

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by zachypin · Nov 17, 2011 at 08:05 PM

I see this is answered, but I keep getting directed here with my Google queries, so I figured I'd throw in what I've been searching for, for a while.....

I took a raw file from OpenSim and wanted to import it into Unity3D. Had the same jagged edges in the picture above, except it was the entire terrain. Problem was that the raw was RGB, and Unity only works with greyscale. I'm currently looking for a converter, asking if anyone knows about one here: http://answers.unity3d.com/questions/187059/convert-rgb-heightmap-to-greyscale.html?viewedQuestions=7652&viewedQuestions=8574.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image pescalona · Mar 31, 2016 at 05:55 PM 0
Share

"Had the same jagged edges in the picture above, except it was the entire terrain."

As did I. Turned out it was because I was leaving the "Byte Order" import setting as "Windows" when it needed to be set to "$$anonymous$$ac" for that particular .raw file.

avatar image danijelfilipovic050 · Oct 12, 2021 at 08:53 PM 0
Share

This is what caused my problems. In Photoshop, I had the image as an 8bit RGB. Changed it to 8bit grayscale and it works perfectly. Thank you very much.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to use Height Maps 2 Answers

City Engine - Unity: Terrain mismatch 8 Answers

Problem with heightmap and terrain height maxing out at 10000, proportions *Solved* 0 Answers

Photoshop heightmap chunks not lining up 0 Answers

Importing Heightmaps 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges