I need to create some terrain from a heightmap I’ve been provided (with a single large matching color-map) and have had little success.
The source images are ~5K squares. I’m aware that the color map has to be power-of-2 sized and can only go up to 4K, and it seems the same is true with the heightmap. The source images are also jpeg-compressed (nothing i can do about that )
I converted the heighmap to RAW data (even tried a version giving it 16-bit depth) and tried to import to Unity. I don’t quite understand the different resolution options, but no arbitrarily small or large value seemed to make a difference. The first thing I noticed is that after bringing in the terrain, the scene slows to a crawl (after a pretty lengthy import process). Moving the terrain manually introduces a frame lag of more than a few seconds, and I can hear my hard drive seeking like crazy (paging virtual memory I guess?)
Once the terrain is in place, if I use a very large, fuzzy smoothing brush, I can get it to not look like crap (no idea bout a performance increase, but it’s not noticable). However, I’d have to hand-smooth every single nook and cranny of the terrain, which isn’t exactly an optimal solution.
Can anybody point me in the right direction here? Is a 4K heightmap just too absurdly large for this kind of thing?
Heightmaps have to be power-of-two-plus-one. The max Unity will do is 2049x2049. (It should do 4097x4097, but a bug of some kind prevents that from happening.)
I’ve noticed that bug (when changing heightmap resolution), but I can actually get the 4096 map to import fine (well, other than the problems I identified above). A different version comes in with LOTS of little holes in the flat terrain (along with the ridges from before) I can’t seem to find any actual value difference in the photoshop document, so I’m not sure what’s causing them.
I found that using a 1025x1025 heightmap got rid of the “pockmarks” in the flat terrain, but the features were still ridged. Do I need to adjust the terrain resolution?
A 16-bit heightmap would be much better than a 8-bit heightmap (256X better in fact), and would get rid of that terracing. Simply converting 8-bit to 16-bit won’t help though, it should be 16-bit to begin with. If that’s not possible, you could try loading 8-bit into Photoshop, change to 16-bit, and then blur it and export it.
Hahahaha I just realized you were quoting that terrible song.
You could also download the terrain toolkit and use the smoothing on it, would essentially accomplish the same thing as blurring in photoshop (whenever I gaussian blur a raw in photoshop i get some subtle gradiation anyway… tough to tell in PS but results in terraces in Unity).
But yeah, your slowdown is because of the millions of tris being created by that noise/terracing.