Dev Diary #047 - Investigating RAW Conversion Problems

posted in ProjectTaival
Published November 25, 2019
Advertisement

Hi, and welcome to this weeks Dev Diary!

Today I'm going to talk about last weeks attempts to get the heightmaps working in Unity. I assumed it would be an easy task, as GIMP offers the option to save image files into RAW format, but looks were deceiving once again.


The Road So far

I found this tutorial on how to make terrain within Unity, by adding a preview version of Terrain Tools from the Unity Package Manager. I noticed that you can also import heightmaps using that same tool, which was the actual thing I was looking for, when I bumped into the video tutorial - how to create terrain in Unity, by importing heightmaps.

well, I checked if GIMP supports saving into RAW format and it does. I then went on to slice my image as per the previous tutorial that I made, in order to save all the sliced up images into RAW format. Everything went smoothly, but slicing a 65k image into 32 x 32 (or 1024) pieces took little more than 2 hours by it self. After that was done, I then proceeded to import the RAW files to Unity as heightmaps, which took almost 4 hours. After the process was done, I couldn't see any height differences on the surface that was created.

I tried to check the RAW files, but saw that GIMP couldn't open them by it self and one of the recommendations for opening RAW files, is a third party software called Darktable, which should be able to open RAW files with GIMP - still, GIMP or Darktable couldn't recognize the RAW files, claiming that there is no such file or such file could not be opened. I then tried to open the RAW files with Photoshop and the image was pure white, no trace of the original image that it should have been.

I then tried to upscale the original 3000 x 3000 heightmap into 4096 x 4096 image, using Photoshop. Saved the image as Photoshop RAW and tried it out in Unity. This time, the image file worked as expected. Also loading the image file on Photoshop loads up the picture just fine. When I tried to open up the same RAW file using Darktable, it still claimed, that it was unable to open the file or that the file was missing.

After that, i tried to save the same image file using gimp, into a RAW file, but still, it wouldn't work when Imported on Unity. I tried all the combinations on the save file settings, that saving as a RAW file gives, using either normal / standard ways to save the file, or some other method, but neither worked in any combination.


The Mystery

What gives? Why doesn't GIMP RAW files work? What am I missing? As I'm just a novice in almost every aspect of image technology, there is plenty of limitations of image file format interchangeability and such, that I do not know. It might be, that GIMP can only save RAW files from very limited amount of source file formats, which prevents me from saving grayscale PNG files straight to RAW when using GIMP.

Luckily, I found this workaround, which lets you use plain png images as heightmaps, but this won't make the process automated, when you need to import multitude of heightmaps for thousands of tiles.


Conclusion

The next weeks agenda is to continue looking into how to import heightmaps efficiently with Unity, or if I could find some kind of script with which I could use the existing PNG files to automatically apply them into multiple times, by using matching naming schemes between the tile and the PNG image.

This is it for today and I thank you for tuning in. See you on the next one!

You can check out every possible mid week announcements about the project on these official channels;

YouTubeFacebookTwitterDiscordRedditPinterestSoundCloudLinkedIn

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement