Table of Contents

Class

Provides stateless, deterministic 32-bit noise using integer indexing and optional seeding.

[BurstCompile]
public static class SquirrelNoise32Bit
Inheritance
object

Fields

DefaultNoiseType

Represents the default noise type used in the SquirrelNoise32Bit class for noise generation methods. The default value is NoiseType.MangledBitsBalancedMix, which provides balanced mixing of bits for noise generation.

private const NoiseType DefaultNoiseType = MangledBitsBalancedMix

Field Value

NoiseType

Methods

Billow(float3, uint, int, float, float, float, float, bool, NoiseType)

Generates a 3D Billow noise value by using a series of octaves and applying transformations to create a smooth, continuous noise pattern. This function allows customization of frequency, amplitude, lacunarity, gain, and noise type, and can optionally normalize the result.

public static float Billow(float3 p, uint seed = 0, int octaves = 5, float frequency = 1, float amplitude = 1, float lacunarity = 2, float gain = 0.5, bool normalize = true, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The 3D position input as a float3 vector.

seed uint

An optional seed value to initialize noise generation. Default is 0.

octaves int

The number of noise layers or octaves to combine. Default is 5.

frequency float

The base frequency of the noise. Default is 1.

amplitude float

The base amplitude of the noise. Default is 1.

lacunarity float

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

gain float

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

normalize bool

Determines whether to normalize the output to the range [-1, 1]. Default is true.

type NoiseType

The type of noise algorithm to use. Default is MangledBitsBalancedMix.

Returns

float

A float value representing the computed Billow noise, optionally normalized to the range [-1, 1].

Cellular2D(float2, uint, float, float, CellularDistance, NoiseType)

Computes 2D cellular noise based on the given input parameters, including position, seed, frequency, jitter, distance metric, and noise type. The function calculates distances between the input position and feature points within a grid, determining the closest feature points, their distances, and the corresponding grid cell.

public static HashBasedNoiseUtils.Cellular2DResult Cellular2D(float2 p, uint seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The input position in 2D space for computing the cellular noise.

seed uint

A seed value for deterministic noise generation. Defaults to 0.

frequency float

The frequency scaling factor for altering the noise detail. Defaults to 1.

jitter float

The amount of displacement applied to feature points within cells. Defaults to 1.

metric HashBasedNoiseUtils.CellularDistance

The metric used to calculate distance between points. Options include Euclidean, Manhattan, and Chebyshev. Defaults to Euclidean.

type NoiseType

The noise type dictating the algorithm used for producing hash values. Defaults to the implementation's default noise type.

Returns

HashBasedNoiseUtils.Cellular2DResult

A HashBasedNoiseUtils.Cellular2DResult representing the computed cellular noise, including distances to feature points, positions, and grid cell data.

Cellular3D(float3, uint, float, float, CellularDistance, NoiseType)

Generates a 3D cellular noise pattern based on the given parameters using a specified algorithm. The result contains the closest two feature points, their distances, coordinates, and origin cells.

public static HashBasedNoiseUtils.Cellular3DResult Cellular3D(float3 p, uint seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The position in 3D space where the noise is evaluated.

seed uint

An unsigned integer seed value to introduce randomness.

frequency float

The scale of the noise, controlling how detailed the noise pattern appears.

jitter float

A value to adjust the randomness of feature points within each cell; ranges from 0 (no jitter) to 1 (maximum jitter).

metric HashBasedNoiseUtils.CellularDistance

The distance metric used to compute distances between feature points and the input position (e.g., Euclidean, Manhattan, Chebyshev).

type NoiseType

The noise generation type dictating the specific algorithm or behavior of the noise function.

Returns

HashBasedNoiseUtils.Cellular3DResult

A Cellular3DResult structure containing the closest two feature point distances, the coordinates of the nearest feature point, and the cell indices for the best feature point.

CellularEdge01(float2, uint, float, float, CellularDistance, float, NoiseType)

Computes a cellular-based noise value mapped to the range [0, 1] with specific edge characteristics. Allows customization of frequency, jitter, metric, edge width, and noise type. Great default for “wormy” patterns: Euclidean + jitter=1.0.

public static float CellularEdge01(float2 p, uint seed = 0, float frequency = 0.005, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.1, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The input 2D coordinates to evaluate the noise at.

seed uint

The seed value for randomization, ensuring deterministic output for the same seed.

frequency float

The frequency of the noise, affecting the scale of features.

jitter float

The jitter factor to introduce randomness into the cellular pattern.

metric HashBasedNoiseUtils.CellularDistance

The distance metric used to compute cell distances (e.g., Euclidean, Manhattan, or Chebyshev).

edgeWidth float

The width of the edge effect in the noise pattern, controlling the transition.

type NoiseType

The noise type, specifying the algorithm used for random number generation and value mixing.

Returns

float

A floating-point value in the range [0, 1], representing the computed cellular noise at the specified input.

CellularEdge01(float3, uint, float, float, CellularDistance, float, NoiseType)

Calculates a procedural cellular edge effect that transitions smoothly between cell boundaries. The result is a normalized value in the range [0, 1] where the smoothness of the edge is controlled by the specified edge width.

public static float CellularEdge01(float3 p, uint seed = 0, float frequency = 0.006, float jitter = 0.9, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.12, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The input 3D position where the cellular noise will be evaluated.

seed uint

An optional seed value for controlling the randomness of the cellular noise.

frequency float

The frequency of the cellular noise, which influences the scale of the generated pattern.

jitter float

Controls the variation of cell point positions. A higher value results in more irregular cell distributions.

metric HashBasedNoiseUtils.CellularDistance

The distance metric used for calculating the cellular noise, such as Euclidean or Manhattan.

edgeWidth float

The size of the edge transition, defining how smoothly the noise transitions between cells.

type NoiseType

Specifies the noise variation type to be used (e.g., Mangled Bits, Mangled Bits Balanced Mix).

Returns

float

A normalized float value representing the procedural edge effect at the specified position.

CellularEdgeExp01(float2, uint, float, float, CellularDistance, float, NoiseType)

Computes a value that represents the exponential weighting of cellular edge noise between the first and second feature points, normalized to the range [0, 1]. The result applies an exponential decay falloff: exp(-k*(F2-F1)) based on the difference between the distances to the two closest feature points. Larger k ⇒ thinner/sharper lines.

public static float CellularEdgeExp01(float2 p, uint seed = 0, float frequency = 0.005, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float k = 8, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The 2D point in space for which to calculate the noise.

seed uint

An optional integer seed used for random generation, which affects the noise calculation.

frequency float

The frequency of the cellular noise. Higher values result in finer noise patterns.

jitter float

The amount of randomness applied to the feature point positions. A value of 1.0 adds full jitter.

metric HashBasedNoiseUtils.CellularDistance

The distance metric used to determine the distance between feature points. Options include Euclidean, Manhattan, and Chebyshev distance.

k float

The exponential scaling factor that determines how quickly the weighting decays based on the feature point distances.

type NoiseType

The type of noise algorithm used. Defaults to a balanced mix of mangled bits.

Returns

float

A floating-point value between 0 and 1 that represents the weighted contribution of the cellular edge noise.

CellularEdgeExp01(float3, uint, float, float, CellularDistance, float, NoiseType)

Computes a cell-based edge noise function normalized between 0 and 1, uses exponential weighting to emphasize cellular vein patterns. The noise is derived based on a 3D coordinate and various parameters affecting frequency, jitter, and distance metric.

public static float CellularEdgeExp01(float3 p, uint seed = 0, float frequency = 0.006, float jitter = 0.9, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float k = 8, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

A 3D coordinate input.

seed uint

A seed value for randomization (default is 0).

frequency float

The frequency of the cellular noise (default is 0.006).

jitter float

The amount of displacement applied to the cell points (default is 0.9).

metric HashBasedNoiseUtils.CellularDistance

The metric used to calculate the distance between cells (default is Euclidean).

k float

An exponential scaling factor influencing the contrast of the noise (default is 8).

type NoiseType

The noise type used for hashing (default is MangledBitsBalancedMix).

Returns

float

A floating-point value normalized between 0 and 1 representing the weighted cell edge noise.

CellularEdgeSigned(float2, uint, float, float, CellularDistance, float, NoiseType)

Evaluates a signed cellular edge noise value at a given point in 2D space. The result is derived by scaling and offsetting the unsigned cellular edge noise to produce a signed range of values.

public static float CellularEdgeSigned(float2 p, uint seed = 0, float frequency = 0.005, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.1, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The 2D coordinates at which to evaluate the noise.

seed uint

The seed value for generating deterministic noise. Defaults to 0.

frequency float

The frequency of the noise, which determines the scale of noise features. Defaults to 0.005f.

jitter float

The amount of jitter applied to the grid points. Higher values produce more variation. Defaults to 1.0f.

metric HashBasedNoiseUtils.CellularDistance

The distance metric used for cellular noise computations, which affects the shape of features. Defaults to Euclidean.

edgeWidth float

The width of the edge region. This controls the blend between edges and cell interiors. Defaults to 0.1f.

type NoiseType

The noise type used for calculations, affecting the mixing and appearance of the final result. Defaults to MangledBitsBalancedMix.

Returns

float

A signed float value representing the cellular edge noise at the given point, normalized to a range of [-1, 1].

CellularEdgeSigned(float3, uint, float, float, CellularDistance, float, NoiseType)

Computes a signed cellular noise value by generating patterns of cellular structures. The output is scaled and shifted to a signed range of -1 to 1.

public static float CellularEdgeSigned(float3 p, uint seed = 0, float frequency = 0.006, float jitter = 0.9, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.12, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The 3D position input as a float3 vector.

seed uint

The seed value used for deterministic randomness. Defaults to 0.

frequency float

The frequency of the noise, controlling the size of individual cells. Defaults to 0.006f.

jitter float

The amount of jitter applied to modify the cell center positions. Defaults to 0.9f.

metric HashBasedNoiseUtils.CellularDistance

The distance metric used to determine cellular patterns (e.g., Euclidean, Manhattan, etc.). Defaults to CellularDistance.Euclidean.

edgeWidth float

The width of the cellular edges. Smaller values produce sharper edges. Defaults to 0.12f.

type NoiseType

The noise type used to calculate cellular patterns. Defaults to NoiseType.MangledBitsBalancedMix.

Returns

float

A float value representing the signed cellular noise, scaled to the range -1 to 1.

CellularF1(float2, uint, float, float, CellularDistance, NoiseType)

Computes the F1 value for cellular noise at a given 2D point. The F1 value represents the distance to the nearest feature point, offering a basis for cellular noise generation. Convenience: return F1 only.

public static float CellularF1(float2 p, uint seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The 2D point for which the F1 noise value is computed.

seed uint

The seed value for generating deterministic noise results.

frequency float

The frequency at which the noise is sampled, affecting the size of the cells.

jitter float

The amount of jitter applied to feature point positions within the cells.

metric HashBasedNoiseUtils.CellularDistance

The distance metric used to compute feature point distances, such as Euclidean or Manhattan.

type NoiseType

The type of noise used for hashing and mixing values, e.g., Mangled Bits or ChaCha variants.

Returns

float

The F1 value, representing the distance to the nearest feature point from the input point.

CellularF2MinusF1(float2, uint, float, float, CellularDistance, NoiseType)

Computes the difference between the second and first closest distances (F2 - F1) for a 2D cellular noise function at a given point. Convenience: classic “cell edges”: F2 - F1.

public static float CellularF2MinusF1(float2 p, uint seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The 2D point at which the cellular noise function is evaluated.

seed uint

The seed value used for the noise calculation. Defaults to 0.

frequency float

The frequency factor applied to the noise function. Defaults to 1f.

jitter float

The amount of jitter applied to cell positions. Defaults to 1f.

metric HashBasedNoiseUtils.CellularDistance

The distance metric used to calculate noise. Defaults to Euclidean.

type NoiseType

The noise type used for hashing. Defaults to MangledBitsBalancedMix.

Returns

float

The difference between the second and first closest distances (F2 - F1) in the cellular noise result.

CellularFill01(float2, uint, float, float, CellularDistance, NoiseType)

Generates a procedural cellular noise value in the range [0, 1]. The computation is based on a 2D point, with optional parameters controlling seed value, frequency, jitter, distance metric, and noise type. Normalized F1 fill in [0,1] (2D)

public static float CellularFill01(float2 p, uint seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The 2D position for evaluating the cellular noise.

seed uint

An optional seed value to control noise generation (default is 0).

frequency float

The frequency to scale the input position by (default is 1).

jitter float

The jitter level to affect cell boundary shapes (default is 1).

metric HashBasedNoiseUtils.CellularDistance

The distance metric used for cellular computation (default is Euclidean).

type NoiseType

The noise type determining hashing and mixing behavior (default is MangledBitsBalancedMix).

Returns

float

A float value in the range [0, 1] representing the computed cellular noise at the input position.

CellularFill01(float3, uint, float, float, CellularDistance, NoiseType)

Generates a noise-based value mapped to a range of 0 to 1 using cellular noise. The noise is influenced by parameters for frequency, jitter, distance metric, and noise type.

public static float CellularFill01(float3 p, uint seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The input 3D point for which noise will be generated.

seed uint

A seed value for ensuring deterministic results. Defaults to 0 if not provided.

frequency float

Controls the scale of the noise. Higher values result in smaller features. Defaults to 1.

jitter float

Determines the amount of randomness in cell boundaries. Defaults to 1.

metric HashBasedNoiseUtils.CellularDistance

Specifies the distance metric used in cellular noise computation. Defaults to Euclidean.

type NoiseType

Defines the type of noise to apply. Defaults to MangledBitsBalancedMix.

Returns

float

A normalized noise value between 0 and 1 for the given input parameters.

DomainWarp(float3, uint, float, float, int, float, float, int, float, float, float, NoiseType)

Generates domain-warped noise based on a given position, seed, and various warp and value noise parameters. Used to create complex, non-repetitive noise patterns by warping the input domain.

public static float DomainWarp(float3 p, uint seed = 0, float warpAmplitude = 1, float warpFrequency = 0.5, int warpOctaves = 1, float warpLacunarity = 2, float warpGain = 0.5, int valueOctaves = 5, float valueFrequency = 1, float valueGain = 0.5, float valueLacunarity = 2, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The input 3D position at which to evaluate the noise.

seed uint

The seed value for generating random noise, enabling reproducibility. Defaults to 0.

warpAmplitude float

The amplitude of the warp distortion. Higher values result in more intense warping. Defaults to 1f.

warpFrequency float

The frequency of the warp distortion, controlling the scale of the warp pattern. Defaults to 0.5f.

warpOctaves int

The number of octaves to use for the warp noise. Higher values provide more detail. Defaults to 1.

warpLacunarity float

The lacunarity of the warp noise, affecting the frequency increment between octaves. Defaults to 2f.

warpGain float

The gain of the warp noise, controlling the contribution of each octave. Defaults to 0.5f.

valueOctaves int

The number of octaves to use for the value noise evaluation at the warped position. Defaults to 5.

valueFrequency float

The frequency of the value noise evaluation, controlling the scale of the value pattern. Defaults to 1f.

valueGain float

The gain of the value noise, controlling the contribution of each octave. Defaults to 0.5f.

valueLacunarity float

The lacunarity of the value noise, affecting the frequency increment between octaves. Defaults to 2f.

type NoiseType

The type of noise to use for the computations, specifying different blending or mixing mechanisms. Defaults to the default noise type.

Returns

float

A single float value representing the computed domain-warped noise at the specified position.

FBm(float3, uint, int, float, float, float, float, bool, NoiseType)

Generates a fractal Brownian motion (fBm) value using noise functions and specified parameters. Combines multiple octaves of noise to produce a fractal-like effect, with adjustable frequency, amplitude, and other properties.

public static float FBm(float3 p, uint seed = 0, int octaves = 5, float frequency = 1, float amplitude = 1, float lacunarity = 2, float gain = 0.5, bool normalize = true, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The 3D position at which the noise should be evaluated.

seed uint

A seed value used for noise generation to ensure repeatability.

octaves int

The number of noise layers (octaves) to combine. Higher values create more detail.

frequency float

The base frequency of the noise function. Higher values increase the noise frequency.

amplitude float

The initial amplitude of the noise. Determines the range of values for the first octave.

lacunarity float

The rate of frequency change between octaves. Defaults to 2, doubling the frequency per octave.

gain float

The rate of amplitude change between octaves. Defaults to 0.5, halving the amplitude per octave.

normalize bool

Specifies whether the result should be normalized based on the amplitude sum of all octaves.

type NoiseType

The type of noise function to use for generating noise values.

Returns

float

A floating-point value representing the fBm noise at the given position. Normalized to ~[-1,1] when normalize is true.

Get1DNoise(int, uint, NoiseType)

Returns a 32-bit unsigned integer containing reasonably well-scrambled bits, based on a given (signed) integer input parameter (position/index) and [optional] seed. Kind of like looking up a value in an infinitely large [non-existent] table of previously generated random numbers.

The base bit-noise constants were crafted to have distinctive and interesting bits and have so far produced excellent experimental test results.

public static uint Get1DNoise(int index, uint seed, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

index int
seed uint
type NoiseType

Returns

uint

Remarks

Squirrel Eiserloh call this particular approach SquirrelNoise, specifically SquirrelNoise3 (version 3).

Get1DNoise01(int, uint, NoiseType)

Generates a deterministic pseudo-random floating-point value between 0.0 and 1.0, inclusive. This method is derived from a 1D deterministic noise generation function.

public static float Get1DNoise01(int index, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

index int

A signed integer representing the input position or index for the noise generation process.

seed uint

An optional 32-bit unsigned integer used as a seed value to alter the randomness deterministically. Defaults to 0 if not provided.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

float

A single-precision floating-point value ranging from 0.0 to 1.0, representing the computed 1D noise.

Get1DNoiseNeg1To1(int, uint, NoiseType)

Generates a deterministic pseudo-random noise value based on a 1-dimensional index and an optional seed, normalized to a range between -1 and 1.

public static float Get1DNoiseNeg1To1(int index, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

index int

A signed integer representing the index or position used to generate the noise value.

seed uint

An optional 32-bit unsigned integer used as a seed for controlling the randomness of the output. If not specified, the default seed value is 0.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

float

A floating-point value in the range of -1 to 1, representing the normalized pseudo-random noise.

Get2DNoise(int, int, uint, NoiseType)

Computes a 2D pseudo-random noise value based on the input coordinates and an optional seed. This method generates a deterministic random noise value using the given x and y coordinates combined with the seed.

public static uint Get2DNoise(int x, int y, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

The x-coordinate used as input for generating the noise value.

y int

The y-coordinate used as input for generating the noise value.

seed uint

An optional 32-bit unsigned integer used as a seed to influence the randomness of the generated value. Defaults to 0 if not specified.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

uint

A 32-bit unsigned integer representing the computed pseudo-random noise value for the specified 2D coordinates.

Get2DNoise01(int, int, uint, NoiseType)

Generates a deterministic 2D noise value scaled to the range [0, 1]. This method combines two-dimensional coordinates and an optional seed to produce pseudo-random output.

public static float Get2DNoise01(int x, int y, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

The x-coordinate for generating the noise value.

y int

The y-coordinate for generating the noise value.

seed uint

An optional 32-bit unsigned integer value to alter the randomness. Default is 0.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

float

A floating-point number in the range [0, 1] representing the generated noise value.

Get2DNoiseNeg1To1(int, int, uint, NoiseType)

Generates a deterministic pseudo-random noise value for two-dimensional integer coordinates and normalizes the result to a floating-point value within the range of -1 to 1.

public static float Get2DNoiseNeg1To1(int x, int y, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

The X-coordinate used to determine the position for generating noise.

y int

The Y-coordinate used to determine the position for generating noise.

seed uint

An optional 32-bit unsigned integer seed to modify the behavior of the noise generation. The default value is 0.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

float

A floating-point value within the range of -1 to 1, derived from the generated pseudo-random noise.

Get3DNoise(int, int, int, uint, NoiseType)

Generates a deterministic pseudo-random 32-bit unsigned integer value based on the provided 3D coordinates and an optional seed. This method computes noise by combining the x, y, and z coordinates with prime multipliers, and then applies a 1D noise function.

public static uint Get3DNoise(int x, int y, int z, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

An integer representing the x-coordinate in 3D space used for the noise calculation.

y int

An integer representing the y-coordinate in 3D space used for the noise calculation.

z int

An integer representing the z-coordinate in 3D space used for the noise calculation.

seed uint

An optional 32-bit unsigned integer used as a seed to control the randomness of the output. Defaults to 0 if not provided.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

uint

A 32-bit unsigned integer representing the deterministic pseudo-random noise value calculated using the input coordinates and seed.

Get3DNoise01(int, int, int, uint, NoiseType)

Generates a 3D noise value between 0.0 and 1.0 using deterministic pseudo-random algorithms. This method computes noise based on 3D coordinates and an optional seed value.

public static float Get3DNoise01(int x, int y, int z, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

An integer representing the X-coordinate in the 3D space for noise generation.

y int

An integer representing the Y-coordinate in the 3D space for noise generation.

z int

An integer representing the Z-coordinate in the 3D space for noise generation.

seed uint

An optional 32-bit unsigned integer used to alter the randomness of the generated noise. The default value is 0.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

float

A floating-point value between 0.0 and 1.0 representing the calculated deterministic 3D noise.

Get3DNoiseNeg1To1(int, int, int, uint, NoiseType)

Generates deterministic pseudo-random noise for a 3D coordinate and normalizes the result within the range of -1 to 1.

public static float Get3DNoiseNeg1To1(int x, int y, int z, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

The x-coordinate used in the noise generation process.

y int

The y-coordinate used in the noise generation process.

z int

The z-coordinate used in the noise generation process.

seed uint

A 32-bit unsigned integer used to control the randomness and reproducibility of the output. Defaults to 0 if not specified.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

float

A floating-point value within the range of -1 to 1, representing the normalized noise for the given coordinates and seed.

Get4DNoise(int, int, int, int, uint, NoiseType)

Computes a 32-bit unsigned integer noise value in four dimensions based on the input coordinates and an optional seed. This function is deterministic and produces consistent results for the same inputs.

public static uint Get4DNoise(int x, int y, int z, int w, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

The x-coordinate as a signed integer representing the first dimension in the noise space.

y int

The y-coordinate as a signed integer representing the second dimension in the noise space.

z int

The z-coordinate as a signed integer representing the third dimension in the noise space.

w int

The w-coordinate as a signed integer representing the fourth dimension in the noise space.

seed uint

An optional 32-bit unsigned integer used to control the randomness of the noise generation. Defaults to 0.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

uint

A 32-bit unsigned integer representing the computed noise value.

Get4DNoise01(int, int, int, int, uint, NoiseType)

Computes a 4D noise value normalized to the range [0, 1]. This function generates pseudo-random noise for a four-dimensional space based on the provided coordinates and an optional seed.

public static float Get4DNoise01(int x, int y, int z, int w, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

The X-coordinate in the 4D space.

y int

The Y-coordinate in the 4D space.

z int

The Z-coordinate in the 4D space.

w int

The W-coordinate in the 4D space.

seed uint

An optional 32-bit unsigned integer used to control the randomness of the output. Defaults to 0 if not specified.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

float

A floating-point value between 0 and 1 representing the normalized 4D noise.

Get4DNoiseNeg1To1(int, int, int, int, uint, NoiseType)

Generates a deterministic pseudo-random noise value in 4D space and normalizes it to the range of -1 to 1. This method ensures consistent results for the same inputs, making it suitable for procedural generation.

public static float Get4DNoiseNeg1To1(int x, int y, int z, int w, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x int

The X coordinate, an integer used to determine the noise position in the 4D space.

y int

The Y coordinate, an integer used to determine the noise position in the 4D space.

z int

The Z coordinate, an integer used to determine the noise position in the 4D space.

w int

The W coordinate, an integer used to determine the noise position in the 4D space.

seed uint

A 32-bit unsigned integer used as a seed value to control the randomness of the output. Defaults to 0.

type NoiseType

The noise generation type, which defines the noise computation method.

Returns

float

A floating-point value in the range of -1 to 1, representing the normalized 4D noise value.

GetCellSeed2D(int2, uint, NoiseType)

Generates a 2D cell seed using the provided cell coordinates and world seed. The resulting value is determined by applying a specific noise function.

public static uint GetCellSeed2D(int2 cell, uint worldSeed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

cell int2

The 2D coordinates of the cell as an int2 structure.

worldSeed uint

A seed value that determines the randomization of the noise function. The default value is 0.

type NoiseType

The type of noise function to use. The default is NoiseType.MangledBitsBalancedMix.

Returns

uint

A 32-bit unsigned integer representing the cell's seed value.

GetCellSeed3D(int3, uint, NoiseType)

Generates a seed value for a specific 3D cell in space using 3D noise functions. The resulting value is determined by the cell coordinates, a world seed, and the selected noise type.

public static uint GetCellSeed3D(int3 cell, uint worldSeed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

cell int3

The 3D integer coordinates of the cell.

worldSeed uint

An optional seed value to differentiate results across different worlds or contexts. Defaults to 0.

type NoiseType

The type of noise used for generating the seed. Defaults to MangledBitsBalancedMix.

Returns

uint

Returns a 32-bit unsigned integer representing the generated 3D cell seed.

GetUInt128(int, uint, NoiseType)

Computes a 128-bit unsigned integer by combining two 64-bit pseudo-random numbers derived from the input parameters. This method generates low and high 64-bit components based on a deterministic noise function.

public static ulong2 GetUInt128(int index, uint seed, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

index int

A signed integer used to indicate the position or index for generating pseudo-random noise.

seed uint

A 32-bit unsigned integer used as an additional input to control the randomness of the output.

type NoiseType

The noise generation type that determines the method used for computing the noise values. Optional, defaults to a predefined type if not provided.

Returns

ulong2

An instance of ulong2 representing a 128-bit unsigned integer, composed of two 64-bit pseudo-random values.

GetUInt64(int, uint, NoiseType)

Generates a 64-bit unsigned pseudo-random integer by combining two noise values. This method uses a deterministic noise function derived from the provided parameters.

public static ulong GetUInt64(int index, uint seed, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

index int

A signed integer representing the index or position used for generating the pseudo-random value.

seed uint

A 32-bit unsigned integer serving as a secondary input to influence the randomness of the output.

type NoiseType

The noise generation algorithm type that specifies the method for producing the noise values. If not specified, a default noise type is used.

Returns

ulong

A 64-bit unsigned integer combining two noise components (high and low) to produce a unified pseudo-random value.

GradientCentral(float2, uint, float, NoiseType)

Calculates the central gradient of a 2D Perlin noise function at a given point. This method estimates the gradient by sampling the function in each dimension using a small step size and computing the finite differences.

public static float2 GradientCentral(float2 p, uint seed, float eps = 0.001, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

A float2 instance representing the 2D coordinates where the gradient should be evaluated.

seed uint

A 32-bit unsigned integer used as an additional input to control the randomness of the Perlin noise.

eps float

A small floating-point value representing the step size used for computing finite differences. Defaults to 1e-3f.

type NoiseType

The noise generation type that influences the Perlin noise computation. Optional, defaults to NoiseType.MangledBitsBalancedMix.

Returns

float2

A float2 instance representing the gradient vector at the specified coordinates. The x and y components of the returned vector correspond to the gradient along the x and y axes, respectively.

GradientCentral(float3, uint, float, NoiseType)

Calculates the central gradient of the Perlin noise function at a given point in 3D space. It computes the gradient by approximating partial derivatives across all axes using central difference with a small epsilon step size for numerical differentiation.

public static float3 GradientCentral(float3 p, uint seed, float eps = 0.001, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The 3D point where the gradient is evaluated.

seed uint

The seed value used for noise generation, ensuring determinism.

eps float

The small step size used for central difference computation. Default is 1e-3f.

type NoiseType

The type of noise function used, defaulting to MangledBitsBalancedMix.

Returns

float3

A float3 vector representing the gradient of the noise function at the specified point.

Perlin(float, float, float, uint, NoiseType)

Generates a Perlin noise value based on the input coordinates and a specified seed. This method calculates smooth noise by blending integer-based deterministic noise values at each corner of the cube enclosing the input coordinates.

public static float Perlin(float x, float y, float z, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x float

The x-coordinate of the noise input.

y float

The y-coordinate of the noise input.

z float

The z-coordinate of the noise input.

seed uint

A 32-bit unsigned integer used to control the pseudo-randomness of the noise generation.

type NoiseType

Specifies the type of noise function to use for generating corner values. Defaults to MangledBitsBalancedMix.

Returns

float

A single-precision floating-point value representing the Perlin noise at the given coordinates.

Perlin(float, float, uint, NoiseType)

Generates a Perlin noise value based on the provided 2D coordinates, seed, and noise type. The noise value is computed by hashing the corners of the surrounding grid and applying interpolation.

public static float Perlin(float x, float y, uint seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x float

The X coordinate (continuous) used for generating the noise value.

y float

The Y coordinate (continuous) used for generating the noise value.

seed uint

An optional 32-bit unsigned integer seed to enhance the determinism of the noise generation. Defaults to 0 if not provided.

type NoiseType

The type of noise used to hash the corners of the grid. Defaults to the method's default noise type.

Returns

float

A floating-point value representing the generated Perlin noise.

PerlinWithDeriv(float, float, float, uint, out float3, NoiseType)

Computes Perlin noise with derivatives for the given coordinates and seed value. The method generates smooth noise and calculates gradients based on the noise type.

public static float PerlinWithDeriv(float x, float y, float z, uint seed, out float3 d, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x float

The x-coordinate in the 3D noise space.

y float

The y-coordinate in the 3D noise space.

z float

The z-coordinate in the 3D noise space.

seed uint

The seed value used for generating consistent noise output.

d float3

The resulting gradients of the Perlin noise, provided as a float3 vector.

type NoiseType

The noise type used to control the behavior and mixing of the noise, with a default value.

Returns

float

The computed Perlin noise value for the provided input.

PerlinWithDeriv(float, float, uint, out float2, NoiseType)

Generates a Perlin noise value with derivative, based on the provided 2D coordinates, seed, and noise type.

public static float PerlinWithDeriv(float x, float y, uint seed, out float2 d, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x float

The x-coordinate for the noise calculation.

y float

The y-coordinate for the noise calculation.

seed uint

The seed value used for deterministic noise generation.

d float2

The derivative of the noise with respect to x and y, returned as a float2.

type NoiseType

The type of noise to generate; defaults to the specified DefaultNoiseType.

Returns

float

A float value representing the generated Perlin noise at the given coordinates.

Ridge(float3, uint, int, float, float, float, float, float, float, bool, NoiseType)

Computes a ridge noise value using Perlin noise with specific parameters such as frequency, amplitude, lacunarity, gain, ridge offset, and ridge sharpness. This function applies multiple octaves of noise generation and can optionally normalize the output across the range [-1, 1].

public static float Ridge(float3 p, uint seed = 0, int octaves = 5, float frequency = 1, float amplitude = 1, float lacunarity = 2, float gain = 0.5, float ridgeOffset = 1, float ridgeSharpness = 2, bool normalize = true, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The input 3D position for the noise function.

seed uint

The seed value to ensure determinism in the generation. Default is 0.

octaves int

The number of noise octaves used to compute the ridge noise. Default is 5.

frequency float

The starting frequency for the noise generation. Default is 1f.

amplitude float

The starting amplitude for the noise generation. Default is 1f.

lacunarity float

The frequency multiplier applied after each octave. Default is 2f.

gain float

The amplitude multiplier applied after each octave. Default is 0.5f.

ridgeOffset float

The offset applied to the ridge transformation. Default is 1.0f.

ridgeSharpness float

The sharpness applied to the ridge calculation. Default is 2.0f.

normalize bool

A boolean flag indicating whether the resulting noise values should be normalized across the range [-1, 1]. Default is true.

type NoiseType

The noise type used for the computation. Default is MangledBitsBalancedMix.

Returns

float

A float value representing the computed ridge noise. The output can range from [-1, 1].

Simplex2DCore(float2, uint, float, NoiseType)

Generates 2D simplex noise at a given position using specified parameters. The noise function allows adjustable parameters such as seed, frequency, and noise type.

public static float Simplex2DCore(float2 position, uint seed = 0, float frequency = 1, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

position float2

The 2D position at which to sample the noise.

seed uint

The random seed used for generating the noise. Defaults to 0.

frequency float

The frequency of the noise. Defaults to 1.0.

type NoiseType

The type of noise to use, defined by the NoiseType enum. Defaults to MangledBitsBalancedMix.

Returns

float

Returns a single precision float value representing the generated noise at the specified position.

Simplex3DCore(float3, uint, float, NoiseType)

Generates a 3D simplex noise value based on the input position, seed, frequency, and noise type.

public static float Simplex3DCore(float3 position, uint seed = 0, float frequency = 1, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

position float3

The 3D position in space for which the noise value should be calculated.

seed uint

A seed value used to initialize the noise generation. Defaults to 0.

frequency float

The frequency of the noise, altering the scale at which it repeats. Defaults to 1.

type NoiseType

The specific noise type to be used in the calculation. Uses the default noise type if not specified.

Returns

float

A floating-point value representing the computed 3D simplex noise at the given position.

UberNoise(float3, uint, int, float, float, float, float, float, int, float, float, int, float, NoiseType)

Generates a procedural noise value based on chained domain warps and fractional Brownian motion (fBm), with optional ridge component subtraction. This method produces rich and detailed noise patterns by combining multiple layers of octaves, domain warping, and ridging, allowing for enhanced control over frequency, amplitude, and tonal complexity. “Uber” composition inspired by Watch on YouTube

public static float UberNoise(float3 p, uint seed = 0, int octaves = 6, float frequency = 1, float lacunarity = 2, float gain = 0.5, float warp1Amp = 0.75, float warp1Freq = 0.5, int warp1Oct = 2, float warp2Amp = 0.35, float warp2Freq = 1.2, int warp2Oct = 2, float ridgeMix = 0.3, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The input 3D position for noise evaluation.

seed uint

The seed value for noise generation, ensuring repeatability.

octaves int

The number of noise layers (octaves) to compute for fBm.

frequency float

The base frequency of the noise function.

lacunarity float

The frequency multiplier for each successive octave.

gain float

The amplitude multiplier for each successive octave.

warp1Amp float

Amplitude of the first domain warp.

warp1Freq float

Frequency of the first domain warp.

warp1Oct int

Number of octaves used for the first domain warp.

warp2Amp float

Amplitude of the second domain warp.

warp2Freq float

Frequency of the second domain warp.

warp2Oct int

Number of octaves used for the second domain warp.

ridgeMix float

The weight used to mix the ridged noise component with fBm.

type NoiseType

The noise type that alters how the procedural noise is calculated.

Returns

float

A procedural noise value clamped between -1 and 1.

ValueAndGrad(float, float, uint, out float2, NoiseType)

Computes the value of Perlin noise and its gradient at a given 2D point.

public static float ValueAndGrad(float x, float y, uint seed, out float2 grad, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

x float

The x-coordinate of the input point.

y float

The y-coordinate of the input point.

seed uint

A seed value for the noise generation.

grad float2

An output parameter that returns the 2D gradient vector of the noise value at the input point.

type NoiseType

The type of noise to use during computation.

Returns

float

The Perlin noise value at the given 2D point.

ValueAndGrad(float2, uint, out float2, NoiseType)

Computes a Perlin noise value at a given 2D position and provides the gradient of the noise at that position. The method uses a noise function influenced by the provided seed and noise type to generate the result.

public static float ValueAndGrad(float2 p, uint seed, out float2 grad, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

A float2 representing the 2D position where the noise value is evaluated.

seed uint

A 32-bit unsigned integer that determines the seed used for generating the noise.

grad float2

An output parameter of type float2 that contains the gradient of the noise at the given position.

type NoiseType

The noise generation type that determines the method used for computing the noise values. Defaults to a predefined type if not provided.

Returns

float

A float representing the computed Perlin noise value at the specified position.

ValueAndGrad(float3, uint, out float3, NoiseType)

Computes the Perlin noise value at the given point and calculates its gradient.

public static float ValueAndGrad(float3 p, uint seed, out float3 grad, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The input position represented as a 3D vector.

seed uint

The seed value used to ensure deterministic noise generation.

grad float3

The resulting gradient of the Perlin noise at the specified position.

type NoiseType

The type of noise to be used for computation.

Returns

float

Returns the Perlin noise value at the given position.

WorleyBlocky2D(float2, uint, float, float, CellularDistance, float, NoiseType)

Generates a 2D Worley noise value with a blocky aesthetic. The noise is evaluated based on the input position and a variety of parameters influencing the frequency, jitter, distance metric, edge blending, and noise type. Defaults: Chebyshev, jitter=0.1, freq=0.01, edgeWidth=0.1.

public static float WorleyBlocky2D(float2 p, uint seed = 0, float frequency = 0.01, float jitter = 0.1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Chebyshev, float edgeWidth = 0.1, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The 2D position at which to evaluate the noise.

seed uint

The seed value for randomization. Default is 0.

frequency float

The frequency of the noise pattern. Default is 0.01f.

jitter float

The amount of jitter to apply to cell points. Default is 0.1f.

metric HashBasedNoiseUtils.CellularDistance

The distance metric used to compute cellular distances. Default is Chebyshev.

edgeWidth float

The width of the edge blending between cells. Default is 0.1f.

type NoiseType

The type of hash-based noise used for value generation. Default is MangledBitsBalancedMix.

Returns

float

A float value representing the Worley noise result at the specified position. Cellular edges in [-1,1]

WorleyBlocky3D(float3, uint, float, float, CellularDistance, float, NoiseType)

Computes a 3D Worley noise with a blocky appearance using the specified parameters. The calculation uses Cellular Edge Signed noise with adjustable frequency, jitter, and edge width.

public static float WorleyBlocky3D(float3 p, uint seed = 0, float frequency = 0.012, float jitter = 0.1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Chebyshev, float edgeWidth = 0.12, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The 3D position to sample the noise at.

seed uint

An optional seed value to control the randomization of the noise.

frequency float

The frequency scale of the noise.

jitter float

The amount of randomness in the cell positions.

metric HashBasedNoiseUtils.CellularDistance

The cellular distance metric used for computing noise, such as Chebyshev or Euclidean.

edgeWidth float

The width of the edges between cells in the noise.

type NoiseType

The noise type used for hashing during calculations.

Returns

float

A floating-point value representing the computed 3D Worley noise at the given position. Cellular edges in [-1,1]

WorleyWormy2D(float2, uint, float, float, CellularDistance, float, NoiseType)

Generates a signed 2D Worley noise value based on the given position, seed, frequency, and other parameters. This function uses cellular edge detection and supports multiple distance metrics for noise computation. 2D “Wormy” (veiny) Cellular edges in [-1,1]. Defaults: Euclidean, jitter=1.0, freq=0.005, edgeWidth=0.1.

public static float WorleyWormy2D(float2 p, uint seed = 0, float frequency = 0.005, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.1, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float2

The 2D position for which the noise value is computed.

seed uint

An optional seed value to introduce variability in noise generation. Defaults to 0.

frequency float

The frequency scale applied to the noise pattern. Defaults to 0.005.

jitter float

The level of jitter applied to the cell points. Higher values increase randomness. Defaults to 1.0.

metric HashBasedNoiseUtils.CellularDistance

Specifies the distance metric used in cellular noise calculations. Defaults to Euclidean.

edgeWidth float

Defines the width of the edges between cells in the noise pattern. Defaults to 0.1.

type NoiseType

The type of noise used for computation. Defaults to MangledBitsBalancedMix.

Returns

float

A signed floating-point value representing the computed 2D Worley noise at the specified position.

WorleyWormy3D(float3, uint, float, float, CellularDistance, float, NoiseType)

Generates a 3D Worley noise value with signed distance based on provided parameters. This function computes the noise by analyzing the nearest feature points in a 3D space, applying a jitter and a frequency for distortion, and returns a signed edge value based on the distance metric and edge width. 3D “Wormy” (veiny) Cellular edges in [-1,1].

public static float WorleyWormy3D(float3 p, uint seed = 0, float frequency = 0.006, float jitter = 0.9, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.12, NoiseType type = NoiseType.MangledBitsBalancedMix)

Parameters

p float3

The input 3D position for noise computation.

seed uint

The seed value for noise generation, used to ensure deterministic results.

frequency float

The frequency scale of the noise pattern, determining its granularity.

jitter float

The amount of perturbation applied to feature points, affecting the noise detail.

metric HashBasedNoiseUtils.CellularDistance

The distance calculation mode (e.g., Euclidean, Manhattan, Chebyshev).

edgeWidth float

The width of the noise's edge transition, influencing edge smoothness.

type NoiseType

The noise algorithm used, determining the hashing method and sequence.

Returns

float

A floating-point value representing the signed edge with applied noise in 3D space.