Trouble importing png for heightmap file UE5-0

UE5.0.1
How do I get a heightmap exported from GIMP to work?

File ‘T_Mountain_01_hm’ doesn’t have proper pattern(ex: _x0_y0.png)
No matter what settings I try and use when exporting from GIMP I get this error.
Copying the default heightmap image from Landscape Quickstart Guide works.

image

I have the same problem. I was able to get it working, but can’t remember the settings I used, and am stuck on it again. Tried 8bit, 16bit, rgb, raw, png, grayscale, etc… Renamed the file to _x0_y0.png. Nothing works. I’m also using GIMP. If I rename the file, then the exclamation goes away, but when I click import, I get the message again.

UPDATE:
Got it working. Not sure what exactly changed. I upgraded GIMP to the latest. Deleted the asset from within the UE Content Browser, which deletes the .uasset file. Saved the image as 8-bit, upon Import, the editor gave a warning about 8-bit being lower quality. Changed the setting in GIMP to 16-bit, exported, overwriting the image. This caused UE to prompt for import. Clicked Import. Selected the file, and this time it worked.

My GIMP image settings: 16-bit Grayscale. Color Management is enabled. Precision 16-bit & Perceptual gamma.

To be honest, I don’t think it’s the GIMP settings, because I tried these things already. I think perhaps once you try to import the image as a height map, UE caches the path or file, and fails to refresh it in subsequent tries, or something of the likes. Once it fails, it doesn’t refresh from disk or something. Although I did try restarting the editor, but that did not fix the issue.

1 Like

To the OP, what size is your terrain, and what tile sizes did you use?
More information would be helpful.

World Partition has a totally different set of valid heightmap sizes and tile sizes than UE4 does.
For large tiled worlds you can no longer go by the UE4 documentation for Recommended Landscape sizes, that is only relevant with World Partition up to 8129x8129. Beyond that the values are totally different between World Composition and World Partition.
So if you use a non-recommended World Partition size, you will end up with either a cropped or padded terrain heightmap, which might affect what you are doing.

1 Like

I hae the same issue, but with photoshop. No matter how I save the file - it says that the file type is not recognized. When I download literally ANYTHING from the internet - it WORKS. If I resave the same pictures in photoshop - they do not work.
image

I think I just solved it. My masks are in Gaea but I’d imagine World Machine has the same nodes. I had a height + slope mask node to get the snow-capped mountain effect I needed. I combined with a COMBINE NODE. Unreal gave me the error above.

So I went back into Gaea and added an “Fx” node after the “Combine” Node and marked it for export. Using the “Fx” node as a mask I resolved the error.

CORRECTION: You mark the OUTPUT of the “Fx” node, not the node itself. I suppose you could put an “output” node after “Fx”, or use the next connected node after Fx’s output pin.

I also had this problem with another combine node and now I know why. Hope this helps. I can post screenshots if needed.

Also, remember to open your UE5-Imported masks and set compression to “masks no sRGB”

Here is my example using Gaea. Bottom line is, combine nodes don’t seem to work as landscape masks in the UE5 Landscape Editor.

I import my masks via Landscape editor/Manage/Import. This method require (1st) your terrain heightmap and (2) Gaea-generated masks for each landscape material layer.

If you import your masks via content browser make sure to open the masks in the texture viewer and set compression to "masks (no sRGB). If they weren’t already greyscale [e.g. straight out of Gaea], they’ll appear RED in your content browser and usually give the masked material a red tint, but I’ve found a fix for this …

In UE5, importing a non-greyscale mask produces a RED tinted mask. I tried using material masks with Unreal Sensei’s auto landscape material and others like it. Dylan has another great auto landscape (ALMMC2). If those red-tinted masks add a red tint to your masked materials then extract the RED channel from the texture sample. That sounds counter-intuitive as apposed to the green channel but it’s what works. Is this a bug in UE5? I prefer doing this instead of converting the [gaea-exported] RED masks to greyscale to keep resolution high. I’ve tried converting Gaea masks to greyscale to prevent this, but in doing so lost a lot of mask resolution, resulting in many artifacts in my masked materials.

Hope this resolves everyone’s issues. Images below.

Image #1: Connect a “Fx” node to the output of your combined masks

Image #2: Export the OUTPUT of that Fx node as your final mask.

Image #3: Those pesky, red masks I talked about

1 Like

Cool! For me, I switched to Krita, although I don’t think that was the issue. When saving a file from Krita (and possibly Gimp), it creates a second file (possible temp file?). So if my image name is ‘test.png’, it will create a file ‘~test.png’. I was able to get past the issue by deleting this file, deleting the file from Content Browser, and reimporting it. Seems to work for me.

I found an alternative solution to this. There seems to be an issue with the nodes “marked for export”, This error also appeared for me when attempting to import heightmap to UE5. To resolve this, I created an output node from the relevant combiner to get the correct heightmap generated. In the Ouput node, you need go to its properties and set the format to RAW (16 bit).

image

image

When importing to UE5, use the relevant Output.raw

Scale will still need to be adjusted in UE5 as it differs to Gaea.

Hope this helps!

I was having a similar issue.
You can try a few things:

  • Don’t name it with so many underscores followed by numbers (try just T_Mountain.png or even just Mountain.png)
  • Don’t have other pngs with similar names in the same folder (I was having an issue because mine was called Terrain_1.png but I also had a Terrain_1_try2.png in the same folder and UE5 was freaking out trying to read those as tiles).
1 Like

Mine said invalid. I renamed the file to a single word with .png ending, then browsed to it again. Then it said ambiguous … with x0_y0, so i renamed the file to a different single word name with .png ending and browsed to it again. Then it was valid.