Procedural Generation of Limited Terrain

I would like to implement procedural landscape creation. After careful research, I came to the conclusion that it should be implemented using one of the algorithms for generating a gradient of (coherent) noise, for example, the Perlin Noise algorithm. However, I do not want the generation to be completely random. I would like to apply some restrictions (for example, where the mountain range should be, or where the lowland should be, etc.).

Question:

For example, I have a curve representing some element of the landscape. A curve is an array of points.

  • How can I improve the Perlin Noise algorithm so that the curve noise will have a preferred range of values ​​(or, for simplicity, a value of 0)?
  • Alternatively, if I have a texture that is the output of the Perlin Noise algorithm (array 2d), how can I convert it to the desired noise (influenced by the curve)?
+4
source share
1 answer

How can I improve the Perlin Noise algorithm so that along this curve the noise will have a preferred range of values ​​(or, for simplicity, a value of 0)?

This can be achieved by converting each pixel into a map using a simple mathematical function p -> f(p).

, - ​​ , , ( , ).

Cosine value transform

, ( ).

Cosine value transform II

"" ( ) ( ).

enter image description here

( ) - . , ( , ).

( )

(, -1.0 - 1.0), :

function scaleValuesTo(heightMap, newMin, newMax)
{
    var min = min(heightMap);
    var range = max(heightMap) - min;
    var newRange = newMax - newMin;

    for each coordinate x, y do:
        hrightMap[x, y] = newMin + (heightMap[x, y] - min) * newRange / range;
    end for
}

(, , ..).

, , . - ( , , ) , . :

1) , ( ). , , , ( ).

2) ​​ . , - : combinedMap[x, y] = templateMap[x, y] + (0.2 + 0.8 * templateMap[x, y]) * noiseMap[x, y].

:

http://matejz.wz.cz/scheme.jpg

( )

+10

Source: https://habr.com/ru/post/1537874/


All Articles