Skip to content
FutureBlitz

    Install

    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.

    std/math/noise.fb, line 69

    • Public Field Octaves: Int field #

      Fbm's octaves of Perlin noise, each Lacunarity times the frequency of the last and Gain times its strength.

    • Public Field Lacunarity: Double field #

      How many times the frequency of each octave is the last one's.

    • Public Field Gain: Double field #

      How many times the strength of each octave is the last one's.

    • Public New() constructor #

      Noise from Ken Perlin's permutation, as his reference has it.

    • Public New(seed: Int64) constructor #

      Noise from a permutation the seed shuffles, so each seed gives a world of its own.

    • @PanicsAtCaller Public Method Perlin(x: Double, y: Double): Float method #

      Perlin noise in 2D, from about -1 to 1: his 3D noise at z = 0.

    • @PanicsAtCaller Public Method Perlin(x: Double, y: Double, z: Double): Float method #

      Perlin noise in 3D, from about -1 to 1, as his improved noise's reference has it.

    • @PanicsAtCaller Public Method Simplex(x: Double, y: Double): Float method #

      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.

    • @PanicsAtCaller Public Method Simplex(x: Double, y: Double, z: Double): Float method #

      Simplex noise in 3D, from about -1 to 1, over a tetrahedron.

    • @PanicsAtCaller Public Method Value(x: Double, y: Double): Float method #

      Value noise in 2D, from -1 to 1: a random value at each whole place, and smooth between.

    • @PanicsAtCaller Public Method Value(x: Double, y: Double, z: Double): Float method #

      Value noise in 3D, from -1 to 1: a random value at each whole place, and smooth between.

    • @PanicsAtCaller Public Method Worley(x: Double, y: Double): Float method #

      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.

    • @PanicsAtCaller Public Method Worley(x: Double, y: Double, z: Double): Float method #

      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.

    • @PanicsAtCaller Public Method Fbm(x: Double, y: Double): Float method #

      Fractal Brownian motion in 2D: Octaves of Perlin noise, added up, from about -1 to 1. Fewer than one octave panics.

    • @PanicsAtCaller Public Method Fbm(x: Double, y: Double, z: Double): Float method #

      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.