Re:Perlin noise
by drcode on Monday May 30, 2016 @02:08PM
(#11802376)
Hmm... Perlin noise is a lot more complex to generate than I was expecting.
[ Parent
| on HN ]
You don't win an Academy Award for Technical Achievement for Math.random()!
Many folks looking for a Perlin-like effect end up using the diamond-square(or "midpoint displacement") algorithm, which has a similar look but a somewhat simpler implementation:
For each segment take the midpoint of the linear interpolation and add noise at a smaller magnitude. Recurse in until you are at the desired scale. In 2D, flip the sample points between a "square" pattern and a "diamond" pattern each time to avoid a boxy tiled look.
The biggest downside of this method is that it's much less flexible about scaling: to get more resolution you have to double each dimension.