Friday, December 20, 2019

procedural generation - Manipulating Perlin Noise


I've been learning about Procedurally Generated Content lately (in particular, Perlin noise). Perlin noise works great for making things like landscapes, height maps, and stuff like that. But now I am trying to generate structures more like mountain ranges (in 2D, as 3D would be way over my head right now) or underground veins of ores.



I can't manage to manipulate Perlin Noise to do this. Making a cut off point (i.e. using only the tops of the 'mountains' of a heightmap) wouldn't work, because I would get lumps of mountains/veins. Any suggestions?


Thanks,
Numeri



Answer



Perlin noise is great for many things - localised terrain, clouds, waves - but when it comes to mountain ranges it's somewhat lacking. The problem is that the output looks like, well, noise. Mountain ranges however are the result of tectonic plates pushing against each other, forming ridges, and so look somewhat like ripples on fabric or paper that's scrunched inwards, albeit very noisy:


A ridge


enter image description here


This is what real mountains look like when you're far enough up


enter image description here


There's no way a single Perlin noise generator, no matter how well tweaked, will recreate these features. Hence my suggestion to use a multi-phase generator, with something to create those ranges, and Perlin noise to add the fine detail like peaks.



Have a look at libnoise, an open source terrain generation library. It uses a composite generator, which includes one that generates ridges. Here's a sneak peek of what it's capable of:


enter image description here


Now compare this with a typical Perlin noise generator, and you can see how it's much better at resembling mountain ranges. This just looks like blobs to me:


enter image description here


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...