Issue Importing Heightmap

First time on the forums and hoping to solve a really frustrating issue when importing a heightmap I got from real world data.

The Issue:

When importing the file (16 bit, grayscale PNG) I get an error stating “file type not recognized”. I checked the details of the PNG and it is indeed 16 bit depth and of course I added grayscale from inside Photoshop.

What I have done:

I got the terrain data from google maps and converted it to a height map using a tool from GitHub which has a convenient converter through google doc. After saving a screenshot of the heightmap I then went to Photoshop and set the color mode to grayscale, 16 bit. After doing this I then saved the image as png. The details as I have gone over already, are showing its correct.

Heightmap png

Thanks for any help that you offer me, I really do appreciate the time and guidance. I try to figure out issues myself and search the old internet super highway but on rare occasions I find myself left puzzled. If there is anything I missed and you need, please let me know!

Although it says that png is acceptable format in the docs here:
Creating and Using Custom Heightmaps and Layers in Unreal Engine | Unreal Engine Documentation

I have found that .raw always works, and png does not. And the terrain creation software I use (world creator) recommends to use the .raw format as well. Actually I’ve read that a few places, though I don’t recall where now.

But try .raw, that will likely solve your problems.

1 Like

Thank for the response, I saved it as a RAW file and it gives me a different error → “File doesn’t have proper pattern (ex: _x0_y0.RAW)”

I think you might want to consider a different tool to the one you downloaded I don’t think it is structuring the data in the right way. Hence the subsequent steps are failing. Also note that you will loose resolution at the screen shot stage leading to tiering.
If you are going to do a lot of terrain work then QGIS is excellent (but has a steep learning curve) if you are just doing a one off then I would do the heightmap to image work directly in photoshop. (See youtube for how to do this).

1 Like

Alright, I appreciate the insight. I started with QGIS but got lost and could not figure out how to export in 16 bits but I literally downloaded and messed with it just yesterday. I’ll take another look at it over there. Photoshop is also really strange though, I can’t get it to export to 16 bit even though I had set everything up for it again. Its weird because I have gotten it to export to 16 earlier lol.

OK for QGIS you need this: Heightmap Export — QGIS Python Plugins Repository

1 Like

Alright, got that installed, thanks again… That would make things a lot easier!

if you are importing tiles it has to follow that naming convention.

I remember some World Creator tutorials covering that in detail but I couldnt find them after a quick search. But if you are using world creator, world machine, or probably any other terrain creation software and you export as tiles, it usually handles that automatically.

Otherwise you can just name the files manually. I am not sure if there is any official unreal documentation about it anywhere or not. But if you are importing a heightmpa as a single terrain, I wouldn’t expect to get that error.

The x0_y0 is just indicating rows and columns so that unreal knows where to put the terrain tile in a grid.

1 Like

Hey, you have been very helpful and I am going to continue to go through QGIS and go about it in that way. Also that’s all very good to know and really can’t thank you enough for all the information. This has been a way better experience compared to forums like Stack Overflow haha.

1 Like

Hello everyone.
Now we did not hear if FyveFourOh could resolve the issue with QGIS.
In fact, used GIMP and exported a heightmap both in RAW and PNG; and in 8 and 16 bit;
in various resolutions. The best advice i could get from team mates and supporters, similar to you Fyve, was that the map resolution might not exactly match the size of the image. I always have this red mark “cannot be imported” when i have chosen my heightmap file in the file selector; and the “import” button is greyed out.
Does anyone else also experience that and what solutions would there be?
I have tried in 4.26, 5.1 and 5.2 with the above picture formats and various resolutions.
Maybe there is a suggested map size (grids, components) correlating to a very specific size of heightmap resolution? Or any other special twists?
Thanks in advance for your insights,
Hannes

I fixed 3 more issues not mentioned above, and now it works for me.
It seems UE5.2 reads heightmap file names differently than 5.1.
What you must do is be careful not to have a point (.) inside your name!
Also, my data folder adress of the image was greater than 256 signs;
so that was fixed by loading that image directly from download folder.
Finally, the heightmap was exported from “Cities:Skylines map generator” with
a HUGE offset in negative Z direction, so that i had to add like 70k in z to make it visible
above a reference plane at 0m height in world origin.
Another note:
YOU CAN USE RAW AND PNG FILES!
Both worked for me.
You should not use 8 bit but 16bit for smooth surface,
and try to maximise resolution for later terrain painting!

Best wishes and happy creating!
Cheers, Hannes