Dynamic Terrain height inconsistency with different sizes of heightmaps

Hi Attila_Lorincz,

tl;dr: The third paragraph contains the only actionable piece of information in this reply, so you can skip to that if you want. The first two paragraphs are just background. Sorry if it gets a little long-winded; terrain generation is a perennial passion of mine. :slight_smile:

This is just a guess, but from looking at your heightmaps, it looks like the frequency of the noise on your large map is much lower than on your small map; in fact it looks like the frequency is perhaps being calculated based on the width of your image, not the resolution. Put a different way, when you cross your small image from one edge to the other, it looks (again, just eyeballing it) like you can expect to cross roughly two major hills and two major valleys on a typical crossing. The same appears to be true for your large heightmap; even though a crossing traverses many more pixels, broadly speaking it looks like you can expect to pass two hills and two valleys on a typical traversal.

If this is accurate, and if the generated terrains are sized based on pixels (i.e., one pixel is 32 meters wide, or something like that), then the output you’re seeing may actually be correct because the slopes on the larger image will be much shallower. As an example, in your small image, it takes roughly 30 pixels (once again, eyeballing it), or 20% of your image width to go from one of the darkest pixels to one of the brightest. In the large image it still takes about 20% of the image width, but that now corresponds to 400 pixels. If the terrain heights are the same – that is, if the height difference between the brightest and darkest pixels is identical – then this difference in noise frequency would cause the slope I just described to be about 13 times shallower in the large image than in the small one, leading to the appearance of flatness you observed.

Again, this is just a guess as to what’s happening; but fortunately, there’s an easy way to check whether noise frequency is really what’s wrong. Generate a new large heightmap that is just your made of your small heightmap tiled over and over again. It will have seams and ugly artifacts, of course, but that doesn’t matter for this test. What’s important is that your new heightmap will have the same noise frequency relative to the pixels as your small map does. If this map comes out looking like your small map tiled over and over again (you may have to fly in a little to see the details), then noise frequency was almost certainly the issue. If the map comes out looking super flat, even from up close, then there might be something else going on.

Again, sorry if I got a bit long-winded. Terrain stuff is just awesome. :smiley:

2 Likes