Getting DEM's into Unity

Hi, I am trying find a workflow to use 32 bit float digital elevation models into Unity as 16 bit terrain height using QGIS and GIMP. Has anyone done this before?

I have the image into GIMP as a 32bit tif, which I convert to a 16 bit unsigned image. But when I try to export it as a .raw, Unity reads the file as an 8 bit image and I lose a lot of fidelity. Any thoughts on why?

It feels like most of the tutorials about height maps on Youtube are out of date with the latest versions of all three programs.


Thanks

  • Jonathan Gonzalez(jgonzalez) replied

    So if I understood correctly you want to import and use a raw height map file for use on terrain? I'm probably one of the few tutorials you've seen on Youtube that have covered it, albeit I always found the process to be tedious. I know Unity upgraded their terrain system so I'd have to go through the steps again to see what the difference is. I didn't use Gimp myself, but Photoshop but I assume Gimp can export a raw file just the same. If you have the file you can share, please post it here, otherwise I'll experiment with my own height map.

  • Phillip Capon(train30) replied

    jgonzalez That's what I am trying to do. The recent Unity raw importers are pretty easy to use, but a bit different than your tutorial. Here's the DEM I am working with. The DEM 150063 file has the original height values in meters. In the Normalized and Scaled file, I rescaled the heights so the lowest is 0 and the highest is 1. I am hoping helps minimize the loss of detail in the 16 bit file.

    https://drive.google.com/drive/folders/1jntsUMDrxJfhk6Y3bO1zqR9GCqDu0JEi?usp=sharing

    I ended up getting Photoshop, and was able to create a 16 bit Raw file. I am wondering now if Gimp can even export a 16 bit raw file at the moment.

    My goal is to find a workflow that lets easily get DEMs into Unity so I can visualize my grading plans at work in first person, and maybe VR. I will probably right some scripts in GIS for clipping and scaling the images once I find a way that works.