#Terrain Generation: Mesh Has spiky ridges

1 messages · Page 1 of 1 (latest)

dreamy tulip
#

I'm building a simple terrain generation based on perlin noise, i want a clear distinction between mounts and plains so i actually generate two maps and blend them together like this:

PerlinNoiseGenerator plainsNoise = new PerlinNoiseGenerator(_settings.Size, _seed);
PerlinNoiseGenerator mountsNoise = new PerlinNoiseGenerator(_settings.Size, _seed * 2)
{
  Modifier = (float perlinValue) =>
  {
    float ridge = 1f - Mathf.Abs(perlinValue * 2f - 1f);
    return ridge * ridge;
  }
};

//And them i blend them like this
float blendMask = Mathf.Clamp01((normalizedMount - _settings.MountainThreshold) / (1f - _settings.MountainThreshold));
blendMask = blendMask * Mathf.Lerp(blendMask, 0.8f, blendMask);
map[x, y] = Mathf.Lerp(plainHeight, mountHeight, blendMask);

Now... i have a problem i can't solve... my mesh is ok in the plains, but mountains are full of spiky ridges, I tried to lower the frequency of the perlin noise and to increase mesh detail but nothing seems to work, does anyone have any idea on how to solve this? Maybe it's a common problem...