Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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
0
Question by GrayRabbitGames · May 16, 2017 at 04:19 PM · imageimportingheightmap

How to make a terrain height map without photoshop?

So i’m following a tutorial for Unity which requires creating a height map using an image editor. As you know, Unity exports the terrain height map as a .raw file, and requires a .raw file to be imported as well. I’ve been trying for the past 90 minutes to get this to work. Here’s what I tried so far… (I am using Mac OSX)

  1. First, I tried importing it into Gimp. This did not work, because Gimp does not appear to support .raw files.

  2. I downloaded UFRaw plugin for Gimp. The plugin was a zip file which contained 75 files, mostly C scripts. According to the instructions for installing Gimp plugins (here: https://en.wikibooks.org/wiki/GIMP/Installing_Plugins#Mac) I simply copy those files to the /Applications/GIMP.app/Contents/Resources/share/gimp/2.0/scripts/ directory. I did so and restarted Gimp, but it still did not accept terrain.raw.

  3. I downloaded RawTherapee and installed it. RawTherapee, for whatever reason, does not recognize the terrain.raw file. I’ve tried right clicking the file and using “open with” and selecting RawTherapee, and I’ve also tried navigating to the file within RawTherapee - in both cases, the file is not recognized.

  4. I tried converting the .raw file to a .jpeg via https://raw.pics.io/ but the website did not recognize terrain.raw.

  5. I downloaded and installed Fiji, which finally opened terrain.raw. I exported it as a .tiff file so that I could open it in Gimp and create a height map - finally some success! But then, of course, Gimp could not save it as a .raw, only .data. I tried exporting the .data and importing that into Unity, no success. I even tried re-naming it to a .raw (just to see if it was an arbitrary naming issue), but when I imported that into Unity it came out flat, without any height.

So I’m not usually one to go and ask questions online before I’ve tried a lot, but I feel like I’ve done my due diligence on this one. Can someone tell me how you can edit and import a height map into Unity without Photoshop? At this point I feel like I’ve tried every suggestion I’ve read on the web - using Gimp, using a Gimp plugin, using a raw-to-tiff converter, using an online converter, etc. Nothing seems to be working.

Any help would be greatly appreciated!

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by longpinkytoes · Mar 06, 2018 at 03:40 AM

  • i have the same question, although GIMP 2.9.8 (2017-12-12) supports exporting to 16-bit raw format. it can now export as .data rgb planar, and import that file back into gimp as gray unsigned little- or big- endian.

  • supplementary: darktable purports to be a full-featured non-destructive raw image manipulation program, although the semantics of game engine vocabulary means this is the wrong kind of raw.

  • maybe some light on the matter:
    https://sozvyezdami.wordpress.com/2015/05/13/on-unity-5-game-engine-heightmaps-photoshop-imagemagick-linux-etc/ [imagemagick has had gray 16-bit little/big endian capability for ten years, since 2008]

Comment
Add comment · Show 4 · 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 longpinkytoes · Mar 06, 2018 at 04:53 AM 2
Share

So. To sum up.

  1. Unity 5 Game Engine Heightmaps use the “Photoshopy” RAW image format, which is not a standard at all.

  2. You can convert PNG, JPEG, etc images to 16 bit grayscale in a Photoshop style RAW heightmap format using the Image$$anonymous$$agick conversion program named “convert”. You need to put the suffix ‘.gray’ on your output file and the ‘-depth 16’ flag on the command.

  3. You may have to play with the Byte Order on the Unity import window

avatar image Marzoa longpinkytoes · Feb 11, 2020 at 12:12 AM 0
Share

Thanks from here too. I was trying to do it with The Gimp but I didn't found a proper way. Imagemagick's convert did the trick perfectly. :D

avatar image manfredfrisch longpinkytoes · Aug 25, 2021 at 09:43 PM 0
Share

Could you share the command line you use to convert images to raw so that Unity can import it?

So far: I had no success with the following:

$ convert TestMap.png -depth 16 test.gray

$ convert TestMap.png -depth 16 -endian LSB test.gray

$ convert TestMap.png -depth 16 -endian MSB test.gray

$ convert --version

Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org Features: Cipher DPC Modules OpenMP Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

avatar image JMFrancia · Mar 13, 2018 at 03:56 PM 1
Share

Thank you for the response! I can't recall how I got around this now, it was so long ago, but I'll be needing to do some terrain work again soon so this is really helpful.

avatar image
0

Answer by Invertex · May 17, 2017 at 11:12 AM

You don't need to save it back out as RAW. You managed to import it into GIMP, so that's what matters. What you want to export it back out as is a 16 or 32bit format that Unity can import, such a TIFF.

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 Boz_1 · Jun 04, 2017 at 11:39 AM 1
Share

To my limited knowledge terrain object doesn't import tiff. which is why the question refers to importing raw. I know that Photoshop works but pricey. Terrain Importer on the asset store imports ter(terraland), tif, tiff, raw 8 & 16 bit and world machine r16, r32. And will to boot flip your images vertical, horizontal or both together rotates 180 degrees. $10 would get you version 1.4, ask him nicely and he may upgrade you to ver 2.

avatar image
0

Answer by manfredfrisch · Sep 06, 2021 at 10:42 AM

Here is a small tool I wrote to convert image files (e.g. png) to raw files compatible with Unity:

https://github.com/bwulff/toraw

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

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

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Import Project from Asset store 6 Answers

Heightmap problems 1 Answer

How do importing image when game is running (Run Time) ???? 0 Answers

About Heightmaps 1 Answer

How do I import a picture, from a standalone application, to be displayed on a texture of some kind? 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