Perlin Noise

john's Avatar

john

06 Aug, 2024 10:26 AM

Attached is a new addition to my library that I DID NOT make myself.

The Perlin Noise algorithm was originally developed by Ken Perkins in 1983 and released (in its original form) without patents. It generates random numbers that have a remarkably natural feel and is used the world over to create realistic landscapes, natural rhythms, and many other marvels. More about it here:

https://en.wikipedia.org/wiki/Perlin_noise

In 2010 Inderjit Gill made a straight line for line conversion to Clojure without any optimizations and released that under an MIT license which you can find here:

https://github.com/indy/perlin/blob/master/COPYING

In 2013, Frederik De Bleser, the co-inventor of Nodebox, posted a Nodebox node which called that Clojure module along with a a simple demo of how to use it:

http://support.nodebox.net/discussions/nodebox-2-3/2765-noise-perlin

Since then it has been used by who knows how many Nodebox artists. I finally decided that it might be easier for people to find if it was also included in my library. I wrote a simple wrapper node around it which adds a scale parameter in the same way Frederik implemented it. (A link to the license is included inside the node.)

Noise takes four floating point parameters:

  • X
  • Y
  • Z
  • Scale (1 or greater)

It returns a random value usually between -1 and 1. (It sometimes returns values slightly outside that range.). You can then use a convert_range node to change that value to a color or an elevation or an angle or whatever. (You can adjust the values of the convert_range node to further refine the output.)

Some possible uses:

  • You can think of the X,Y, Z values as coordinates and interpret the noise value to be the thickness of a cloud at any point in that 3D grid.
  • You could feed a 2D grid into the X and Y parameters and feed time (in the form of a frame node) to the Z value to produce an animation; the noise value could create changing elevations of city buildings at each point, or ever-changing colors.
  • You could feed a range node into any one of the X, Y, or Z parameters, feed the range node as X and the noise node as Y into a make_point node, and connect those points to produce a random undulating wave (like a sum of random sine waves).

In each case you can adjust the scale value up or down to "focus" the pattern, as if you were zooming in or out. The best way to understand this is to play with it and see what happens.

The attached demo shows two of the examples mentioned above. In the first, a 30 x 30 grid of points is fed to the X and Y inputs and time (a frame node) is fed to the Z input. The result is then used to color a rectangle of pixels. Hit Play to see the pattern shift like clouds moving across the sky.

The other example uses a simple range of values (0 to 299) fed to the X input with time fed into the Z input. (You could feed these into any two of the X, Y, and Z inputs for a similar result.). The range and noise values, when fed into a make_point node, create an undulating wave. Hit Play to see it evolve. Then try changing the scale parameter to see how that changes each pattern.

Noise is the secret weapon of any generative artist. I hope including it in my library (v3.4 coming soon) will allow it to be discovered by a new generation of Nodebox artists.

Any veteran Nodebox artists who have been using Frederik's original node: please give my repackaged version a spin and tell me if it looks OK to you. Any newbie Nodebox artists who have never used Perlin Noise before: please give this a try and share something you made with it.

Happy Noise Making!

John

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • Perlin_Noise_Screenshot.png 561 KB
  • noise_node.zip 5.77 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

10 Sep, 2024 03:41 AM
09 Sep, 2024 02:15 PM
07 Sep, 2024 05:16 AM
05 Sep, 2024 02:21 AM
04 Sep, 2024 05:01 AM

 

03 Sep, 2024 10:07 AM
02 Sep, 2024 05:56 AM
31 Aug, 2024 11:07 PM
27 Aug, 2024 12:08 AM
26 Aug, 2024 01:02 PM
26 Aug, 2024 07:18 AM