Back

2D Midpoint displacement

I discovered this algorithm while researching procedural terrain generation. I'm assuming it's an outdated way of doing that, but, contrary to stacking gradient noises on top of each other, I actually understand what this does!

Depth is how many times the space is subdivided and variation controls how much a random value can fluctuate.

It makes sense to have variation going from -1 or 0 to 1. I originally did this using Canvas2D so it retained some of the quirks.

2D Midpoint Displacement
1 10
1 256