- Home /
How do I convert a .RAW terrain file without PhotoShop?
I want to use my preferred photo editor to edit terrain in Unity, but I can't find anything that will read or write Unity's .RAW files for free (Unity's .RAW files seem to be different from, say, Nikon's which these converters expect).
Unity's RAW files just contains RAW date without header or anything special. It's just a stream of color values. The resolution, the color bit count the endianess has to be selected manually when you load the RAW file in Unity. So RAW is just RAW and nothing Unity has invented.
Answer by getyour411 · Mar 26, 2014 at 12:11 AM
Google GIMP
Gimp won't open them. It just appears as mostly gray static
I created a Python script that converts the 16-bit raw file into a 16-bit EXR. The EXR can then be used as a Texture2D.
git repo: https://github.com/Tony$$anonymous$$arkham/unity-raw-to-exr
python package: https://pypi.org/project/unity-raw-to-exr/
Answer by mathieu-axel · Sep 08, 2017 at 06:07 PM
I finally found an online converter for that !
Pixel format: Grayscale bpp1: 16, others at 0. Check Little Endian.
Then right click on the image -> save image as ...
Answer by Croug · May 18, 2015 at 05:41 PM
Someone recommended the program "Fiji" I haven't tried it yet but quite a few people seem to recommend it, give that a try. http://fiji.sc/Downloads
Answer by tanoshimi · May 18, 2015 at 05:56 PM
I use GDAL: https://alastaira.wordpress.com/2013/11/12/importing-dem-terrain-heightmaps-for-unity-using-gdal/
Answer by Kiwasi · Oct 09, 2015 at 09:02 AM
You can also put the data into a texture and use EncodeToPNG
http://docs.unity3d.com/ScriptReference/Texture2D.EncodeToPNG.html
Uhm, maybe i get something wrong, but wasn't the question about importing a terrain heightmap in the RAW format? Unity only supports RAW out of the box.
It requires a bit of dancing around. But you can read the heights off of the terrain height map. Convert them to pixels in a Texture. Then convert that to a png.
It might not be the most efficient solution. But it lets you edit the data in something as simple as Paint.