1
\$\begingroup\$

I am trying to create procedural terrain using Perlin noise here is what I have so far:

  • I create "Chunks" of a fixed size using a Perlin noise function, each chunk is a flat mesh (like a plane).
  • Different Chunks can have different noise parameters (octaves, amplitude, ...) to make some part more like plains or mountains.
  • now because of the noise parameters some chunk borders don't match.

How can I go about this? I have tried to lerp the borders but it makes a flat edge that is kind of ugly.

\$\endgroup\$
1
  • \$\begingroup\$ Maybe you can use bicubic interpolation to make the transition between chunks smoother? \$\endgroup\$
    – Raouf
    Commented Jan 30, 2020 at 1:46

1 Answer 1

3
\$\begingroup\$

Do not assign a biome per chunk.

Instead, compute your biome as a function of position. There are a few popular ways to do this...

  • Compute the low-frequency levels of your height map first (the underlying tectonics and geology not impacted by the surface biome) and combine this with a procedural moisture map, then use this pair of (elevation, moisture) or a derived (temperature, fertility) to look up into a map of biome types, like in this example from jgallant:

    Table of biome types indexed by moisture and temperature

    Note that when you look up into this map with a floating point pair of coordinates, you can find out not only which type of biome cell you're in, but also which biome cells you're close to, and how close you are to the border.

  • Break your map into Voronoi cells, and assign each cell a biome arbitrarily. Again you can peek at the biomes used in adjacent cells, and compute how far you are from those cells (this time in world space distance, rather than temperature-moisture-space)

Now, when you want to assign a height to a point, you generate a height using the rule for the biome it's in AND each nearby biome.

This will give you 3-4 heights for that point, differing opinions according to each neighbouring biome.

Form a weighted average of these heights, using a weight that increases as you move into the interior of the biome cell, and decreases toward zero as you move into a neighbouring cell. You can tune the range of this transition zone to keep the feathering subtle.

This gives a better result than generating each chunk with one biome and then lerping the results only at the edges in a few ways:

  • Since the low frequencies are shared (the tectonics), you won't have adjacent biomes at vastly different baseline heights, so you don't get a sudden vertical wall at the boundaries.

  • Instead of every point near the border of one chunk lerping toward the same value at the nearby edge, each one lerps to a different height chosen for its own position, as if the neighbouring biome continued past the edge. This gives you more variation across the transition zone and a more natural-looking blend that reduces visible artifacts.

  • Your transition regions aren't strictly straight lines in a regular chunk grid, making them less likely to stand out. You can even add some noise into your weights to break up any visible structure further.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .