Difference between revisions of "Perlin noise in 2 dimensions expression"
(add perlin noise page) |
(Add motivation for perlin noise) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
''See [[wikipedia:Perlin_noise|the Wikipedia page on Perlin noise]] for more information.'' | ''See [[wikipedia:Perlin_noise|the Wikipedia page on Perlin noise]] for more information.'' | ||
Perlin noise is an | Perlin noise is an [[Expression]] that takes in two values, an X and Y position, and returns a single value between 0 and 1. The value returned by Perlin noise is a psuedo-random value and can form pleasingly random yet uniformly distributed patterns when viewed alongside neighboring values. | ||
== What do I use this for? == | |||
This is useful when you want something to feel random, but to change smoothly through space. For example, you could generate random terrain by using the X and Y of the card space as inputs, and assigning the Perlin output to the height of the hills at that location. | |||
[https://s.castle.xyz/WfCb3q9Dhg Here] is an example of a deck that uses Perlin noise. To see how it works, [[View Source|view the source]] of the deck in Castle, then [[Inspector|inspect]] the blue square actor. |
Latest revision as of 22:17, 16 May 2022
See the Wikipedia page on Perlin noise for more information.
Perlin noise is an Expression that takes in two values, an X and Y position, and returns a single value between 0 and 1. The value returned by Perlin noise is a psuedo-random value and can form pleasingly random yet uniformly distributed patterns when viewed alongside neighboring values.
What do I use this for?
This is useful when you want something to feel random, but to change smoothly through space. For example, you could generate random terrain by using the X and Y of the card space as inputs, and assigning the Perlin output to the height of the hills at that location.
Here is an example of a deck that uses Perlin noise. To see how it works, view the source of the deck in Castle, then inspect the blue square actor.