Unity terrain height map import, looks very chunky, also how to use 16bit RAW file?

Hi all, thanks for any help-

I just created a beautiful terrain in World Machine 2 (such a great program!), however running into 2 major issues:

  1. I can only import the “low resolution” 8bit RAW files that World Machine creates- I thought Unity could use full 16bit files?

  2. When i import this 8bit file, I get this:


    a nasty, chunky, “terraced” look…

My settings:
-exported RAW file is 2049x2049, 8bit
-terrain has been tried at 2048x2048 and 2049x2049
-windows/mac byteorder

Tested this by creating just a simple photoshop file also. same result. Not seeing a direct answer on forums already…thanks for any suggestions!

Yes. Just plain raw files, no formatting, power of two plus one.

–Eric

1 Like

Oi, erased my own reply twice now…arg!

Thanks for the 16bit confirmation, Eric.

How about smoothing out that terrain though? It seems crazy if we have to smooth it all out by hand, as I’ve seen done…there must be a better way?

Well, since you ask, yes. :wink: Fractscape is quite good for taking an 8-bit heightmap (or even lower res) and reconstructing a 16-bit heightmap from it using fractals. Set the heightmap resolution a few notches below the terrain resolution, and play with the smoothing/roughness/etc. until you get a result you like.

–Eric

I’m more than happy to buy Fractscape :slight_smile:

however…it’s not the 8bit to 16bit thats the issue, since I can export 16bit from World Machine (just gotta work out the kinks). The issue is, even when creating a random hightmap in PS, saving as a 16bit RAW, and even if I apply a ton of blur to the image, the resulting terrain in Unity looks just bad…the same terracing/chunky appearance.

Also, I’ve got a lot of small detail (erosion, etc) saved into that heightmap- I don’t want to lose it to blurring. I’d really like to keep this detail, and also have a high heightmap resolution, so I’d rather not reduce the resolution of it. Can your program do this?

thanks!

I don’t have any issues with 16 bit heightmaps from Photoshop. Are you sure you’re actually using 16-bit greyscale depth and not just saving an 8-bit heightmap as 16-bit? Attached is the result of Render/Clouds and then some blurring.

As far as Fractscape goes, you could set the heightmap to the same resolution as the terrain, but then it doesn’t have any “room” to do any work, so the output won’t be any different from the input. If you reduce the input heightmap resolution to say 513x513, you’d still get 2049x2049 out of it, but it has to invent some detail in order to get rid of the terraced look. Anyway the demo is fully functional aside from the ability to save files, so you can see for yourself if you get acceptable results. (You’d want to turn on the detailed preview in the controls tab in order to actually see 2049x2049, since the default quick preview only goes up to 128x128.)

–Eric

421485--14647--$Screen shot 2010-11-04 at 1.22.24 AM.png

Okay, playing around with Fractscape…very nice, btw!

However, when trying to use my full res hightmap, I still get this:

I can see that by turning the H.Map Res down to 256 or so, I can get it smooth…but then i’m losing all the detail I worked so hard to create. Am I missing something else?

thanks some more :slight_smile:

What if you try 512x512? Probably 1024x1024 is too close to really work. If that doesn’t work, then I’d say that for the amount of detail you want to preserve, Fractscape wouldn’t really be the way to go in this case.

–Eric

:frowning: yeah, 512 is still terraced. I’ll keep trying.

Also, just tried again at the photoshop 16bit thing, and it worked great, thanks! (just a clouds filter etc) No terracing in Unity, didn’t even need to blur it- very nice.

Then, I went ahead and renamed the 16 bit output from World machine from “.r16” to “.raw”, confirmed that it could open in PS (though of course it looked pretty whacky), and imported it to Unity- almost!! I go this crazy terrain (below), with one small spot of perfect…very very odd…

Byte order! Bam! Kappow! Whoosh!

Thanks so much! This 16bit issue was all it was, lol…oh such trouble I could have saved, if only the World Machine exporter would just name the file properly (.r16? wth?).

I’ll be buying a copy of Fractscape ASAP, certain I’ll find a use for it sometime, plus I owe you for prodding me on to this finish :smile: thanks a ton!

Thank you very much, but make sure you’re actually going to use it and not because of a couple of forum messages. :slight_smile:

–Eric

haha, yes yes. Haven’t picked it up yet, but I’ll find a reason, now that I know it exists… :slight_smile:

.raw is a PITA. I wish Unity would support OpenEXR or something like that for terrain heightmap import. Unity 3 already does seem to read OpenEXR files, but apparently there’s no way to get the 32bit data via a script, because Color() uses bytes. :frowning: