Import std.math.noise
std.math.noise
Noise: smooth random values over space, the same at the same place, for terrain, clouds, and wobble: Ken Perlin's improved gradient noise, Stefan Gustavson's Simplex noise, value noise, Steven Worley's cellular noise, and fractal Brownian motion, a sum of Perlin noise's octaves. A Noise's values come from a permutation of 0 to 255: Ken Perlin's own for Noise(), so its Perlin noise is his reference's, or a seed's shuffle. Places are Doubles, so large worlds keep their detail, and the math is IEEE's exact operations, so a place gives the same value on every OS and CPU. A place too far out for an Int64, or NaN, panics.
std/math/noise.fb
Types
Noise
class
Public Class Noise
Smooth random values over space, the same at the same place: Perlin, Simplex, value, and cellular noise, and fractal sums of Perlin noise.
-
Fbm's octaves of Perlin noise, each Lacunarity times the frequency of the last and Gain times its strength.
-
How many times the frequency of each octave is the last one's.
-
How many times the strength of each octave is the last one's.
-
Noise from Ken Perlin's permutation, as his reference has it.
-
Noise from a permutation the
seedshuffles, so each seed gives a world of its own. -
Perlin noise in 2D, from about -1 to 1: his 3D noise at z = 0.
-
Perlin noise in 3D, from about -1 to 1, as his improved noise's reference has it.
-
Simplex noise in 2D, from about -1 to 1: the sum of each corner's gradient over a triangle, which has fewer corners than a square, so it's quicker, and has no grid's lines.
-
Simplex noise in 3D, from about -1 to 1, over a tetrahedron.
-
Value noise in 2D, from -1 to 1: a random value at each whole place, and smooth between.
-
Value noise in 3D, from -1 to 1: a random value at each whole place, and smooth between.
-
Worley noise in 2D: the distance to the nearest of a point in each whole cell, from 0 at one of them up, for cells, scales, and stone. The place's own cell's point is nearer than 1.42, so the nearest is within two cells of it: those of the 5 by 5 around it that could be nearer than the nearest so far are looked in.
-
Worley noise in 3D: the distance to the nearest of a point in each whole cell, which the 5 by 5 by 5 cells around the place's hold, its own cell's point being nearer than 1.74.
-
Fractal Brownian motion in 2D: Octaves of Perlin noise, added up, from about -1 to 1. Fewer than one octave panics.
-
Fractal Brownian motion in 3D: Octaves of Perlin noise, each Lacunarity times the frequency of the last and Gain times its strength, added up, from about -1 to 1. Fewer than one octave panics.
Report an issue with this page or with FutureBlitz on GitHub.