sabato 5 dicembre 2015

Day 91: Perlin Noise

Today I decided to dig a little deeper in mesh generation, and I wrote a class to generate Perlin noise values for realistic terrain generation (actually I just converted a C# class, because it's a simple but boring straightforward piece of code, and I didn't want to spend to much time on it once I got the idea of how it works).

With the perlin noise class I modified the example I posted two days ago. Instead of picking random values for the height of the terrain, now they are sampled from the perlin texture (not really a texture, the values are dinamically generated).

As you can see from the picture the terrain looks way more natural, and close vertices have similar height values.

To simulate even more realistic terrains, the perlin function is called multiple times, and each time the frequency doubles and the height halves, to get the effect of little bumps and irregularities on the surface of the bigger bumbs....this is difficult to see on the picture, because there are not enough vertices and I used a very low value for the eight of the second perlin function.



Nessun commento:

Posta un commento