Gildor's Forums

Author Topic: Exporting a umap yields weird purple/green maps? How do I use them?  (Read 232 times)
bigyihsuan
Newbie
*
Posts: 3


View Profile
Exporting a umap yields weird purple/green maps? How do I use them?
« on: March 16, 2023, 00:17 »

I am trying to extract the map from Railroads Online (UE 4.25) using UE Viewer/umodel to create a black-and-white heightmap of its map. However, when I export the map, what I get are various purple/green maps that are half-transparent. (Below is one example). This is not affected by the Skeletal Mesh and Static Mesh settings.




What sort of map is this, and how can use this to make a black-and-white heightmap?
Logged
spiritovod
Global Moderator
Hero Member
*****
Posts: 1929


View Profile
Re: Exporting a umap yields weird purple/green maps? How do I use them?
« Reply #1 on: March 16, 2023, 02:58 »

I'm not into those things, but you can check here for more info. Tiling order aside, you can get normal map like this from channels of original RGBA image:
norm_r = orig_b
norm_g = orig_a
norm_b = filled with 255

Heightmap would require some math, but I guess it's also possible to convert normal map into heightmap if needed.
Logged
bigyihsuan
Newbie
*
Posts: 3


View Profile
Re: Exporting a umap yields weird purple/green maps? How do I use them?
« Reply #2 on: March 17, 2023, 19:14 »

I'm not into those things, but you can check here for more info. Tiling order aside, you can get normal map like this from channels of original RGBA image:
norm_r = orig_b
norm_g = orig_a
norm_b = filled with 255

Heightmap would require some math, but I guess it's also possible to convert normal map into heightmap if needed.

Quote from: That link you sent
Elevation and normals are packed into 512px × 512px × 32bit tiles. The first byte and the fourth byte are the 8bit coefficients of the normal. The second and third bytes encode a 16bit elevation/height.

I've already managed to stitch these tiles together, since I've figured that the map is 8x8 tiles, with each tile being 512x512px.

So, if the image is in RGBA, RA is the normal map, and GB are the elevation map?

EDIT: Below are the results my code naively combining the images together. I'll note that all of them are very noisy and don't look like normal or height maps. (Note how the purple and green in the original alternate from green to purple from lower elevation to higher elevation.)

Full stitched original:

https://pomf2.lain.la/f/iycsr6xq.png

"Normal" map: (takes B and A channels)

https://pomf2.lain.la/f/vixw2qy8.png

(Very much not a) Height map

https://pomf2.lain.la/f/7paw6eca.png
« Last Edit: March 17, 2023, 22:55 by Gildor » Logged
floxay
Full Member
***
Posts: 83



View Profile
Re: Exporting a umap yields weird purple/green maps? How do I use them?
« Reply #3 on: March 17, 2023, 22:14 »

/I'm not sure people want load in around 100MBytes of PNG files by clicking on this thread/

Looks like this to me if I take blue and alpha: https://i.ibb.co/cLdpRK8/BA.png
Logged
bigyihsuan
Newbie
*
Posts: 3


View Profile
Re: Exporting a umap yields weird purple/green maps? How do I use them?
« Reply #4 on: March 18, 2023, 05:13 »

/I'm not sure people want load in around 100MBytes of PNG files by clicking on this thread/

Looks like this to me if I take blue and alpha: https://i.ibb.co/cLdpRK8/BA.png

Ah, I see. I was using the wrong RGBA struct: I was using RGBA instead of NRGBA.

So, the normal map looks like your image, but the "heightmap" leaves something to be desired. It may need scaling:

https://pomf2.lain.la/f/vjka1xxr.png
« Last Edit: March 18, 2023, 05:27 by bigyihsuan » Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS