API Reference › Noise › Noise.value2
method

Noise.value2

Noise.value2(x, y, seed) -> fixed

Samples 2D **value noise** at (x, y) for the given seed and returns a fixed in [-1, 1]. Value noise assigns a pseudo-random value to each integer lattice point and smoothly interpolates between them with a quintic fade — the cheapest generator here, with a slightly blocky, retro character that suits low-detail height fields, dithering, and per-cell variation.

Because it is a pure function of (x, y, seed) in fixed point, the same arguments always produce the same value on every platform. Sample at a fractional frequency (scale the coordinates) to change feature size.

Parameters

seedthe field selector; different seeds give independent worlds

Example

program Value {
  entry {
    let seed = 1337
    let n = Noise.value2(fixed(3) / fixed(8), fixed(5) / fixed(8), seed)
    print(Math.floor(Noise.unit(n) * fixed(100)))   # a 0..100 height
  }
}
← All symbols