fbm

inline fun fbm(seed: Int, position: Vector4, crossinline noise: (Int, Double, Double, Double, Double) -> Double, octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): Double(source)

Generates a fractal Brownian motion (fbm) value based on the provided noise function.

Return

A Double value representing the combined noise, with frequency and amplitude adjusted per octave.

Parameters

seed

The seed value for the noise function, used to ensure consistent output for the same inputs.

position

The 4D vector representing the coordinates for evaluating noise.

noise

A function that evaluates 4D noise based on a seed and coordinates (x, y, z, w).

octaves

The number of noise layers to combine. Higher values produce more detailed noise patterns.

lacunarity

The frequency multiplier for each successive octave.

gain

The amplitude multiplier for each successive octave.


inline fun fbm(seed: Int, x: Double, y: Double, z: Double, w: Double, crossinline noise: (Int, Double, Double, Double, Double) -> Double, octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): Double(source)

Computes fractal Brownian motion (fBm) using the given noise function.

Return

The resultant fractal Brownian motion value as a Double.

Parameters

seed

An integer seed that initializes the noise generation.

x

The x-coordinate for the initial noise function.

y

The y-coordinate for the initial noise function.

z

The z-coordinate for the initial noise function.

w

The w-coordinate for the initial noise function.

noise

A higher-order function that generates noise based on the seed and coordinate inputs.

octaves

The number of iterations to apply the noise function for calculating fBm. Default is 8.

lacunarity

The frequency multiplier applied at each octave. Default is 0.5.

gain

The amplitude multiplier applied at each octave. Default is 0.5.


inline fun fbm(seed: Int, position: Vector3, crossinline noise: (Int, Double, Double, Double) -> Double, octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): Double(source)

Computes fractal Brownian motion (fBm) at a specific 3D position using a given noise function.

Return

A Double representing the computed fractal Brownian motion value at the given position.

Parameters

seed

The base seed for the noise function, used to initialize the random sequence.

position

The 3D position at which to evaluate the noise.

noise

A lambda function that generates noise based on the seed and 3D coordinates.

octaves

The number of iterations to compute the fBm. Defaults to 8.

lacunarity

Controls the frequency of successive octaves. Defaults to 0.5.

gain

Controls the amplitude of successive octaves. Defaults to 0.5.


inline fun fbm(seed: Int, x: Double, y: Double, z: Double, crossinline noise: (Int, Double, Double, Double) -> Double, octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): Double(source)

Computes fractional Brownian motion (fBm) for a given seed, coordinates, and noise function.

fBm is a procedural noise function that generates continuous, fractal-like patterns by combining multiple octaves of noise at different frequencies and amplitudes.

Return

The computed fBm value as a Double.

Parameters

seed

The base seed value for the noise function.

x

The x-coordinate in the noise space.

y

The y-coordinate in the noise space.

z

The z-coordinate in the noise space.

noise

A function that generates noise values given a seed and coordinates x, y, z.

octaves

The number of noise octaves to combine. Defaults to 8.

lacunarity

The factor by which the frequency is increased for each octave. Defaults to 0.5.

gain

The factor by which the amplitude is decreased for each octave. Defaults to 0.5.


inline fun fbm(seed: Int, position: Vector2, crossinline noise: (Int, Double, Double) -> Double, octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): Double(source)

Computes a fractal Brownian motion (FBM) value for a given 2D position using the provided noise function.

Return

The computed FBM value for the given inputs.

Parameters

seed

The base seed for the noise function.

position

The 2D vector representing the position in space.

noise

A function that generates noise values, taking the seed, x-coordinate, and y-coordinate as inputs.

octaves

The number of layers of noise to generate. Defaults to 8.

lacunarity

The frequency multiplier for each layer of noise. Defaults to 0.5.

gain

The amplitude multiplier for each layer of noise. Defaults to 0.5.


inline fun fbm(seed: Int, x: Double, y: Double, crossinline noise: (Int, Double, Double) -> Double, octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): Double(source)

Generates fractional Brownian motion (fBm) using a base noise function. fBm is a technique to produce fractal-like procedural textures or terrains.

Return

The resulting fractional Brownian motion value.

Parameters

seed

Seed value for the noise function to ensure reproducibility.

x

The x-coordinate input for the noise function.

y

The y-coordinate input for the noise function.

noise

A base noise function that takes a seed, x, and y, and returns a noise value.

octaves

The number of noise layers (also referred to as octaves) to combine. Default is 8.

lacunarity

The frequency multiplier for each successive octave. Default is 0.5.

gain

The amplitude multiplier for each successive octave. Default is 0.5.


inline fun fbm(seed: Int, x: Double, crossinline noise: (Int, Double) -> Double, octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): Double(source)

Computes the fractional Brownian motion (FBM) value for a given input using a specified noise function.

Return

The computed FBM value as a Double.

Parameters

seed

The seed value to initialize the noise function.

x

The input value for which the FBM is calculated.

noise

The noise function that generates noise values based on the seed and input.

octaves

The number of successive noise layers to combine. Default is 8.

lacunarity

The factor by which the frequency increases for each successive octave. Default is 0.5.

gain

The factor by which the amplitude decreases for each successive octave. Default is 0.5.


fun (Int, Double) -> Double.fbm(octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): (Int, Double) -> Double(source)
fun (Int, Double, Double) -> Double.fbm(octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): (Int, Double, Double) -> Double(source)
fun (Int, Double, Double, Double) -> Double.fbm(octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): (Int, Double, Double, Double) -> Double(source)
fun (Int, Double, Double, Double, Double) -> Double.fbm(octaves: Int = 8, lacunarity: Double = 0.5, gain: Double = 0.5): (Int, Double, Double, Double, Double) -> Double(source)