This is a configurable 2D perlin noise implementation designed to show the visual implications of design decisions. This is not performant code; avoid extremely large values.
A few notes:
- If frequency min == max, random noise with interpolation will be displayed. Notice that this does not look organic. I.e., it is not Perlin noise. Try of frequency of 256, 256.
- If frequency max < height || width, pixels will be interpolated. Try a frequency of 2, 2.
- Linear interpolation is suppose to look harsher than the smoother cubic version. I found it to only really be noticeable at lower frequencies.
-
I've implemented two internal representations of the random noise used
to generate Perlin noise. Point value is a simple random value per sample.
Vectors use Matt Zucker's approach.
Vectors add another dimension to the noise at each point, creating an
ever more organic looking noise pattern. However, it seems the vector approach
has more artifacts when using linear interpolation. This is most
noticable at low frequencies.