Jagged Landscape from Heightmap

I am getting jagged landscapes when importing from Unreal in a specific circumstance, which is
A) 200cm cliff (this means the terrain jumps up 200cm from one pixel of the heightmap to another. It doesn’t have to be precisely 200cm this is just the height difference in my example).
B) When the cliff face runs North-East to South-West or vice versa. You can see that in this first image:

In this second image, you can see that the cliff face is perfectly smooth when the cliff face runs North-West to South-East:

It also works just fine running straight North/South or straight East/West (which would be very weird if it didn’t because of the square shape of the pixels).

Is there a way to fix this? I need well-defined cliffs that are about the height of the characters in my game, and this jagged look is very unpleasant. I have no trouble smoothing it out with the landscaping tools, but that is not feasible with our size of map.

I am able to smooth the heightmaps just fine in photoshop, but I need crisp looking cliffs, so if I smooth the cliffs, they no longer look consistently impassable.

I don’t know how to solve the issue; however, I have two, possibly bad, ideas which maybe could be used or maybe could be used to spawn a good idea…

  • What if you created a streaming level which contained the crisp cliffs which is streamed on top of the smooth heightmaps?
  • What if you created a spline and used a mesh that had “rounded” edges such that you could spline form the well-defined cliffs where the characters are to travel within?

Thanks for the ideas. I don’t think 1 would work, because I can essentially do the same thing in photoshop by just putting a crisp layer over the smoothed layer. What you get is a plateau that begins to drop off gradually and then slopes back up to the cliff height, and then drops back down. I can adjust the crisp cliff to be closer in or further out, but what I’m ultimately doing is just adjusting at what point in the gradual drop-off my crisp cliff sits.

For idea 2: I still haven’t done much with splines so I’m not sure; wouldn’t this involve manual editing of the terrain? My terrain is 2448100x2448100 cm2, and I just don’t have the time to do manual editing of that magnitude.

Heightmaps aren’t grpahics. They are data.
And using photoshop immidiately means you loose data. Such as the required data to have steps be smooth.

You never use any visual editors on heightmaps - unless they natively support 16bit. And even then. You usually just don’t.

Regardless of that, the issue could just be the direction of the cliff against the landscape.

Go in mesh mode (vertex view?) And check to see if the cliff positioning is how you actually expect it to be, and not going across several quads.

Generally, each pixel matches a vertex.
And if you did modify in photoshop, you have no guarantee the height value across all pixels is correct…

Thanks for the suggestion to check out the vertices, that was helpful. It seems my problem is due to how the vertices are connected as squares, which a single line between the North-West and South-East corners. So when the cliff runs North-East to South-West, it runs against the connecting lines and causes a jagged cliff-face.

Do you know of any way to change the way the terrain vertices are connected? I’m guessing this is something that shouldn’t be messed with…

About photoshop, I actually built the whole landscape in photoshop (it does support 16 bit), so there’s no data loss. I have found photoshop to be much better than tools like World Machine or World Creator for what I wanted to do, which involved some very specific sculpting along with the ability to procedurally modify layers and transitions as needed.

It’s also really nice because the same painting, with a few blending functions, works perfectly as a map of the world. So I can draw my cities and roads, and then shape my terrain around those as well.

1 Like

Photoshop is not 16 bit.
And height maps are not artistic files.
It’s data.
Each pixel can hold a range from 0 to 65536.
Photoshop barely supports 255 values.

Aside from that.

No there is no solution for cliffs that run orthogonally to the squares.
Usually, you use meshes for cliff caps, so as to hide any landscape (or mesh) deformation.

16bit PNG is a fine format, if exported properly, and will get rid of the quantization artifacts (stairstepping/terracing) when exported properly (from WorldMachine for example), if your issue is caused by lack of precision.

In case it’s not lack of precision, and the heightmap is supposed to look like this elevation-wise (not detail-wise), then the most common solution for improving landscape detail is using smaller scale when creating landscape, so you get better precision then one square per square meter.

sure, but even at a 1% scale you still get the very same issue - and a horrible performance.
For cliff caps at 45degrees it’s just much better to use a dedicated mesh cap.
EVEN if you have to create a HISM BP and add however many 1m instances to cover the area…
Because it’s purely visual, you can also define the height of the cap to be modified in the material.

The alternative to it - think fortnite - is to just not allow 45degree cliffs…

for sheer cliffs people are usually using a static mesh. There just isn’t a way to get that sort of resolution on a landscape and have it at a resolution suitable for real time performance.

you can try to get around it but AAA hasn’t yet and is placing static meshes for cliffs, so, choose your battle wisely.

These particular artifacts just look like funky heightmap. You could spend hours trying to figure out how the heightmap got funky, or you can just smooth brush it, place cliff meshes, and move on.

1 Like