Noise Generator for terrain features

Sin3point14

New Member
GSOC/TSOC 2020
Hello! I have been doing some(some = 1 till now :p ) experimentation on creating "localised noise generators".

Why?
Let's say we want to make a single mountain using noise. We'll create a sparse facet and extend Borders to reserve a region for that mountain. But when we're sampling noise how can we guarantee that the mountain will remain confined to that region? A simple Perlin/Simplex noise function can cause discontinuities on the borders and there isn't any way to guarantee that a peak would occur inside the Border.

I wasn't able to find anything on the internet that aimed to solve such a problem, hence I thought of my own solution!

What I did to solve this?
I made a custom Perlin noise generator that guaranteed that the mountain would be restricted inside the region. It will be easier to explain with this diagram-

2560


The noise generator accepts X and Y in [0,1] and divides the 1x1 region into a 3x3 grid system. Now the gradient vectors which are normally randomised for a Perlin generator are controlled here. The vectors lying on x=0,1 or y=0,1 have hardcoded "outward" directions which will ensure that the noise sampled reaches 0 before reaching the borders. Negative noise values are clamped to 0. The four vectors inside are chosen randomly with a restriction that they will always lie in the centre square and will be more than 10 degrees inclined from the sides of the central square, as shaded in the diagram.

Using this I wrote a world generator to create a single mountain, I got pretty good results :D



The mountains a bit protruded in the X and Z directions but that is because I didn't give the non-corner border vectors proper magnitude and directions :p

This PoC is available at- https://github.com/sin3point14/Terasology/tree/mountain-noise (notice the branch) and https://github.com/sin3point14/VolcanoTest

Now, from this, I propose 2 proper(hopefully?) noise generators for such things when we need to restrict a noise generator in a region-

Restricted Perlin/Simplex Noise Generator



The black grid will be a normal Perlin/Simplex generator and vectors on the yellow line will force the noise values to die to 0 before hitting the borders. The vectors on the black grid can again be manipulated in direction and magnitude as done in my mountain POC to create a guaranteed decreasing noise function which will surely die on the edges.

Its main features are-
  1. Gives a continuous region with multiple peaks.
  2. Frequency of noise can be controlled by controlling tesselation.
  3. The region isn't necessary to be rectangular we could have an arbitrary shaped region and vectors on its border(yellow box in the diagram) could be sampled to face along at the outward normal to ensure the noise dying out.
Radial Noise region selection



This noise function is an amoeba-shaped(I don't know what else this could be called :p) region, selector. Also, the noise value returns a value which gives a sense of the ratio of the distance of the sampled point from the centre to the cut-off contour.

Its main features are-
  1. Requires a rectangular/radial region to be sampled upon.
  2. Will have one peak in the centre of the region.
  3. The "waviness" of the contour can be controlled by controlling the frequency of the Noise function used in the diagram.
Note: This would create great Volcanoes!

Both have different purposes and I'd like to hear everyone's views on this!
Also if anyone could give me some reading material that relates to this problem it would be great!
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
I just stumbled upon this nice youtube channel:


Seemed related ^^ Not particular the single-terrain feature idea, but lots of ideas and visualizations of what we would refer to by facets.
 

ktksan

Member
GSOC/TSOC 2020
Hey!! This would be really useful for the Oasis feature in my proposal. Are you planning to work on it anytime soon??
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
@Sin3point14 As @niruandaleth and me started to work thorugh the world gen tutorial (for the fun of it) we noticed that some bits and pieces could be improved there. Expand on the explanations, or show more images as examples for the influence of different noise parameters.
Your approach here looks to become a "best practice" pattern for creating these distinct terrain features, and it would be great if that would also be documented in the tutorial...
 
Top