Class
- Namespace
- CoreFramework.Random
Provides high-entropy stateless deterministic noise using a ChaCha-inspired mixing function.
[BurstCompile]
public static class SquirrelNoise64Bit
- Inheritance
-
object
Fields
DefaultNoiseType
A constant that defines the default noise type used in the SquirrelNoise64Bit methods. The default value is set to MangledBitsBalancedMix.
private const NoiseType DefaultNoiseType = MangledBitsBalancedMix
Field Value
Methods
Billow(float3, ulong, 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, ulong 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
pfloat3The 3D position input as a float3 vector.
seedulongAn optional seed value to initialize noise generation. Default is 0.
octavesintThe number of noise layers or octaves to combine. Default is 5.
frequencyfloatThe base frequency of the noise. Default is 1.
amplitudefloatThe base amplitude of the noise. Default is 1.
lacunarityfloatThe frequency multiplier for each successive octave. Default is 2.
gainfloatThe amplitude multiplier for each successive octave. Default is 0.5.
normalizeboolDetermines whether to normalize the output to the range [-1, 1]. Default is true.
typeNoiseTypeThe 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, ulong, float, float, CellularDistance, NoiseType)
Computes 2D cellular noise based on the input position, seed, frequency, and other custom parameters. This method evaluates the shortest and second shortest distances from the input position to the feature points within the cellular grid, returning the computed values along with additional information about the closest feature point and grid cell.
public static HashBasedNoiseUtils.Cellular2DResult Cellular2D(float2 p, ulong seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The input 2D position as a float2 value, representing the point in space where the cellular noise is evaluated.
seedulongAn optional unsigned 64-bit integer used to initialize the random number generator for noise computation, adding determinism and variability to the output.
frequencyfloatThe scaling factor applied to the input position, controlling the density of features within the cellular grid. Default is 1.
jitterfloatThe displacement factor ranging from 0 to 1, which determines how much feature points are offset from their grid positions. Higher values result in more irregular patterns. Default is 1.
metricHashBasedNoiseUtils.CellularDistanceSpecifies the distance metric used for computing distances between the input position and feature points (e.g., Euclidean, Manhattan, or Chebyshev). Default is Euclidean.
typeNoiseTypeDefines the noise type, determining the underlying hash algorithm and the approach for mixing values. Default is the framework's default noise type.
Returns
- HashBasedNoiseUtils.Cellular2DResult
An instance of the Cellular2DResult struct, containing the shortest distance, second shortest distance, closest feature point's position, and grid cell coordinates of the closest feature point.
Cellular3D(float3, ulong, float, float, CellularDistance, NoiseType)
Generates cellular noise in 3D space using the specified position, seed, frequency, and noise parameters.
public static HashBasedNoiseUtils.Cellular3DResult Cellular3D(float3 p, ulong seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The 3D position at which to evaluate the cellular noise.
seedulongA 64-bit unsigned integer seed used to introduce variability in the generated noise.
frequencyfloatThe frequency of the noise, determining its scale or repetition. Higher values result in finer details.
jitterfloatThe amount of randomness applied to the base cell locations, affecting the “jitteriness” of the pattern.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to compute cellular distances between feature points (e.g., Euclidean, Manhattan).
typeNoiseTypeThe noise generation type that specifies the algorithm for mixing and producing noise results.
Returns
- HashBasedNoiseUtils.Cellular3DResult
An object containing information about the first and second closest distances to feature points, as well as the corresponding cell position and feature point location.
CellularEdge01(float2, ulong, float, float, CellularDistance, float, NoiseType)
Computes a value representing a cellular noise effect with a smooth edge transition between different cells, normalized to the range [0, 1].
public static float CellularEdge01(float2 p, ulong seed = 0, float frequency = 0.005, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.1, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D position at which to evaluate the cellular noise.
seedulongA 64-bit unsigned integer seed to add randomness to the noise generation.
frequencyfloatThe frequency of the noise, controlling the scale and spacing of cells.
jitterfloatThe amount of positional variation applied to the cell points, influencing the randomness of cell shapes.
metricHashBasedNoiseUtils.CellularDistanceThe distance calculation method used to evaluate the proximity between cell points, such as Euclidean or Manhattan.
edgeWidthfloatThe width of the transition area between different cells, affecting the sharpness of the edges.
typeNoiseTypeThe noise generation type, specifying the underlying algorithm for computing noise values.
Returns
- float
A floating-point value normalized to the range [0, 1], representing the computed cellular edge noise at the given position.
CellularEdge01(float3, ulong, float, float, CellularDistance, float, NoiseType)
Computes a smooth noise value representing a cellular pattern with a customizable edge effect, based on the provided position, seed, frequency, jitter, and edge parameters.
public static float CellularEdge01(float3 p, ulong seed = 0, float frequency = 0.006, float jitter = 0.9, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.12, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The input 3D position in space used to sample the noise value.
seedulongA 64-bit unsigned integer that introduces randomness to the generated noise. Defaults to 0.
frequencyfloatA scalar value that scales the frequency of the cellular noise pattern. Higher values create more detailed patterns. Defaults to 0.006.
jitterfloatA factor controlling the randomness or displacement of cell centers. Higher values lead to more jittered patterns. Defaults to 0.9.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to compute the cellular noise. Defaults to Euclidean.
edgeWidthfloatThe width of the transition between cell edges and their interiors. Smaller values create sharper edges. Defaults to 0.12.
typeNoiseTypeThe noise generation type, specifying the algorithm or mixing strategy for noise computation. Defaults to MangledBitsBalancedMix.
Returns
- float
A floating-point value in the range [0, 1] representing the computed cellular noise with the specified edge effect applied.
CellularEdgeExp01(float2, ulong, float, float, CellularDistance, float, NoiseType)
Computes a value based on cellular noise and transforms it using an exponential decay function, providing a smoothly blended result between cellular distances.
public static float CellularEdgeExp01(float2 p, ulong seed = 0, float frequency = 0.005, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float k = 8, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D coordinate used to calculate the cellular noise at a specific position in space.
seedulongA seed value used to introduce randomness to the cellular noise calculation. Defaults to 0.
frequencyfloatThe frequency of the cellular noise, determining the scale of features. Defaults to 0.005.
jitterfloatThe jitter factor controlling the variability in cell placements within the noise grid. Defaults to 1.0.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to compute cell boundaries, such as Euclidean, Manhattan, or Chebyshev. Defaults to Euclidean.
kfloatA sharpness factor for the exponential decay applied to the cellular noise result. Defaults to 8.0.
typeNoiseTypeThe noise generation type defining the mixing and hashing algorithm for the noise computation. Defaults to MangledBitsBalancedMix.
Returns
- float
A float value in the range [0, 1] representing the transformed cellular noise result, biased by the exponential function.
CellularEdgeExp01(float3, ulong, float, float, CellularDistance, float, NoiseType)
Computes a non-linear cellular noise value in a clamped range of [0, 1], using an exponential vein contrast effect based on the input position and parameters.
public static float CellularEdgeExp01(float3 p, ulong seed = 0, float frequency = 0.006, float jitter = 0.9, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float k = 8, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The 3D position vector used as input for the cellular noise computation.
seedulongA 64-bit unsigned integer that introduces randomness into the noise calculation. Defaults to 0.
frequencyfloatThe frequency of the noise, scaling the input space. Defaults to 0.006f.
jitterfloatA value controlling the irregularity in the distance calculation of cellular features. Defaults to 0.9f.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to compute cellular noise features, such as Euclidean, Manhattan, or Chebyshev. Defaults to CellularDistance.Euclidean.
kfloatA scalar influencing the exponential contrast of the cellular vein effect. Higher values sharpen the contrast. Defaults to 8f.
typeNoiseTypeThe noise generation method to determine the mixing algorithm for noise computation. Defaults to NoiseType.MangledBitsBalancedMix.
Returns
- float
A clamped noise value in the range [0, 1] with non-linear vein structures based on the input parameters.
CellularEdgeSigned(float2, ulong, float, float, CellularDistance, float, NoiseType)
Computes a signed cellular edge noise value in the range [-1, 1] for a given 2D point, based on the provided parameters such as seed, frequency, jitter, distance metric, edge width, and noise type.
public static float CellularEdgeSigned(float2 p, ulong seed = 0, float frequency = 0.005, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.1, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D input point for which the noise value is computed.
seedulongAn optional 64-bit unsigned integer seed value used to introduce randomness into the noise computation.
frequencyfloatA scaling factor that determines the frequency of the noise pattern. Higher values result in more dense patterns.
jitterfloatThe amount of randomness applied to cell points for noise generation. Higher values create more irregular patterns.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to calculate distances between points for cellular noise. Options include Euclidean, Manhattan, and Chebyshev.
edgeWidthfloatThe normalized width of the cellular edges, controlling the transition area between cells.
typeNoiseTypeThe noise generation algorithm type, determining how input values are processed and mixed to produce the noise.
Returns
- float
A signed floating-point value in the range [-1, 1] representing the computed cellular edge noise for the given 2D point.
CellularEdgeSigned(float3, ulong, float, float, CellularDistance, float, NoiseType)
Computes a signed cellular edge noise value based on the given 3D position, seed, frequency, jitter, distance metric, edge width, and noise generation type. The result is remapped to the range [-1, 1].
public static float CellularEdgeSigned(float3 p, ulong seed = 0, float frequency = 0.006, float jitter = 0.9, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.12, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The 3D point for which the cellular edge noise should be computed.
seedulongA 64-bit unsigned integer that adds randomness to the noise computation. Defaults to 0.
frequencyfloatControls the frequency of the noise. Higher values result in more granular noise variation. Defaults to 0.006.
jitterfloatAdjusts the randomness of the cell point distribution. Higher values increase irregularity. Defaults to 0.9.
metricHashBasedNoiseUtils.CellularDistanceSpecifies the distance metric used for calculating cellular distances (e.g., Euclidean, Manhattan, Chebyshev). Defaults to Euclidean.
edgeWidthfloatDetermines the blend width at the edges of cells. Smaller values create sharper edges. Defaults to 0.12.
typeNoiseTypeSpecifies the noise generation type, which determines the method and mixing algorithm used. Defaults to MangledBitsBalancedMix.
Returns
- float
A signed floating-point noise value in the range [-1, 1] derived from cellular edge computation.
CellularF1(float2, ulong, 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, ulong seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D point for which the F1 noise value is computed.
seedulongThe seed value for generating deterministic noise results.
frequencyfloatThe frequency at which the noise is sampled, affecting the size of the cells.
jitterfloatThe amount of jitter applied to feature point positions within the cells.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to compute feature point distances, such as Euclidean or Manhattan.
typeNoiseTypeThe 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, ulong, 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, ulong seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D point at which the cellular noise function is evaluated.
seedulongThe seed value used for the noise calculation. Defaults to 0.
frequencyfloatThe frequency factor applied to the noise function. Defaults to 1f.
jitterfloatThe amount of jitter applied to cell positions. Defaults to 1f.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to calculate noise. Defaults to Euclidean.
typeNoiseTypeThe 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, ulong, float, float, CellularDistance, NoiseType)
Computes a value between 0 and 1 based on cellular noise, given a 2D position, seed, frequency, jitter, distance metric, and noise type. Normalized F1 fill in [0,1] (2D)
public static float CellularFill01(float2 p, ulong seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D position point where the cellular noise is sampled.
seedulongAn optional 64-bit seed for randomness to diversify noise generation.
frequencyfloatThe frequency of the noise, adjusting the scale of the generated pattern.
jitterfloatThe degree of irregularity added to the noise cell boundaries for variation.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used for calculating cellular distances, influencing the noise structure.
typeNoiseTypeThe noise generation type, determining the algorithm used for mixing noise values.
Returns
- float
A floating-point value normalized between 0 and 1, representing the result of cellular noise computation.
CellularFill01(float3, ulong, float, float, CellularDistance, NoiseType)
Computes a 0-1 normalized cellular noise pattern at a specific 3D point based on the provided seed, frequency, jitter, distance metric, and noise generation type. Normalized F1 fill in [0,1] (3D)
public static float CellularFill01(float3 p, ulong seed = 0, float frequency = 1, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The 3D point at which the cellular noise is computed.
seedulongA 64-bit unsigned integer seed value that introduces randomness into the pattern.
frequencyfloatThe frequency of the noise, which alters the scale and detail of the pattern. Higher values produce finer details.
jitterfloatThe degree of irregularity or randomness in the cellular noise's grid cells. Ranges between 0 (no jitter) and 1 (maximum jitter).
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to compute cellular distances, such as Euclidean, Manhattan, or Chebyshev.
typeNoiseTypeThe noise generation type, controlling the underlying computation method for the noise values.
Returns
- float
A floating-point value between 0 and 1 representing the normalized cellular noise result at the given 3D point.
DomainWarp(float3, ulong, float, float, int, float, float, int, float, float, float, NoiseType)
Applies domain warping to a position in 3D space using fractal Brownian motion (FBm) as the primary technique, resulting in a distorted yet consistent noise value.
public static float DomainWarp(float3 p, ulong 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
pfloat3The input 3D position to be warped, represented as a float3 structure.
seedulongAn optional 64-bit unsigned integer seed used to randomize the noise generation process. Default is 0.
warpAmplitudefloatThe amplitude of the warp, which controls the intensity of the distortion. Default is 1f.
warpFrequencyfloatThe frequency of the domain warp, influencing the granularity of the warp. Default is 0.5f.
warpOctavesintThe number of warp octaves, which controls the layering of warp detail. Default is 1.
warpLacunarityfloatThe lacunarity scaling factor between warp octaves. Higher values increase the frequency of each sequential octave. Default is 2f.
warpGainfloatThe gain factor that controls the contribution of each subsequent warp octave to the overall warp effect. Default is 0.5f.
valueOctavesintThe number of octaves used for the evaluation of the warped position, which affects noise detail. Default is 5.
valueFrequencyfloatThe frequency used in evaluating the final noise value at the warped position. Default is 1f.
valueGainfloatThe gain factor for the evaluation of noise value octaves. It influences the amplitude of subsequent octaves. Default is 0.5f.
valueLacunarityfloatThe lacunarity scaling factor for the evaluation of noise value octaves. Default is 2f.
typeNoiseTypeThe noise generation type, which determines the algorithm used for noise computation. Default is MangledBitsBalancedMix.
Returns
- float
A single-precision floating-point value representing the computed noise at the warped 3D position.
FBm(float3, ulong, 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, ulong 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
pfloat3The 3D position at which the noise should be evaluated.
seedulongA seed value used for noise generation to ensure repeatability.
octavesintThe number of noise layers (octaves) to combine. Higher values create more detail.
frequencyfloatThe base frequency of the noise function. Higher values increase the noise frequency.
amplitudefloatThe initial amplitude of the noise. Determines the range of values for the first octave.
lacunarityfloatThe rate of frequency change between octaves. Defaults to 2, doubling the frequency per octave.
gainfloatThe rate of amplitude change between octaves. Defaults to 0.5, halving the amplitude per octave.
normalizeboolSpecifies whether the result should be normalized based on the amplitude sum of all octaves.
typeNoiseTypeThe 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
normalizeis true.
Get1DNoise(ulong, ulong, NoiseType)
Computes a 1D noise value as a 32-bit unsigned integer based on the given index, seed, and noise generation algorithm type.
public static uint Get1DNoise(ulong index, ulong seed, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
indexulongThe input index used to determine the specific noise value computation.
seedulongA 64-bit unsigned integer used as a seed for generating deterministic noise.
typeNoiseTypeThe noise generation type, specified by the NoiseType enumeration, which determines the algorithm and mixing strategy employed during computation.
Returns
- uint
A 32-bit unsigned integer representing the computed 1D noise value.
Get1DNoise01(ulong, ulong, NoiseType)
Generates a 1D noise value normalized to the range [0, 1].
public static float Get1DNoise01(ulong index, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
indexulongThe index used to compute the noise value.
seedulongThe seed value for randomization, defaulting to 0 if not provided.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- float
A single-precision floating-point noise value in the range [0, 1].
Get1DNoiseNeg1To1(ulong, ulong, NoiseType)
Generates a 1D noise value normalized to the range of -1 to 1.
public static float Get1DNoiseNeg1To1(ulong index, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
indexulongThe index used to calculate the noise value.
seedulongThe seed value for ensuring deterministic noise generation.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- float
A floating-point noise value in the range of -1 to 1.
Get2DNoise(ulong, ulong, ulong, NoiseType)
Generates a 2D noise value based on the given x and y coordinates and an optional seed using a deterministic algorithm.
public static uint Get2DNoise(ulong x, ulong y, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe x-coordinate of the point for which to generate 2D noise.
yulongThe y-coordinate of the point for which to generate 2D noise.
seedulongAn optional seed value to modify the noise output. Defaults to 0.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- uint
A 32-bit unsigned integer representing the generated 2D noise value.
Get2DNoise01(ulong, ulong, ulong, NoiseType)
Generates a 2D procedural noise value normalized to the range [0, 1].
public static float Get2DNoise01(ulong x, ulong y, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe x-coordinate of the input position.
yulongThe y-coordinate of the input position.
seedulongA value used to seed the noise generation process, defaulting to 0.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- float
A float value representing the 2D noise, normalized to the range [0, 1].
Get2DNoiseNeg1To1(ulong, ulong, ulong, NoiseType)
Generates a 2D noise value within the range [-1, 1] based on the provided coordinates and seed.
public static float Get2DNoiseNeg1To1(ulong x, ulong y, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe x-coordinate used for the noise generation.
yulongThe y-coordinate used for the noise generation.
seedulongAn optional seed value for the noise function. Defaults to 0.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- float
A floating-point noise value in the range [-1, 1].
Get3DNoise(ulong, ulong, ulong, ulong, NoiseType)
Generates a pseudo-random 3D noise value based on the specified coordinates and seed.
public static uint Get3DNoise(ulong x, ulong y, ulong z, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe X-coordinate for the 3D noise.
yulongThe Y-coordinate for the 3D noise.
zulongThe Z-coordinate for the 3D noise.
seedulongAn optional seed value to influence the noise generation.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- uint
A pseudo-random 3D noise value as a 32-bit unsigned integer.
Get3DNoise01(ulong, ulong, ulong, ulong, NoiseType)
Generates a 3D noise value mapped to the range [0, 1].
public static float Get3DNoise01(ulong x, ulong y, ulong z, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe x-coordinate of the 3D point.
yulongThe y-coordinate of the 3D point.
zulongThe z-coordinate of the 3D point.
seedulongAn optional seed value for noise generation. Default is 0.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- float
A pseudo-random noise value in the range [0, 1].
Get3DNoiseNeg1To1(ulong, ulong, ulong, ulong, NoiseType)
Generates 3D noise in the range of -1 to 1 based on x, y, z coordinates and a seed value.
public static float Get3DNoiseNeg1To1(ulong x, ulong y, ulong z, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe x-coordinate of the noise point.
yulongThe y-coordinate of the noise point.
zulongThe z-coordinate of the noise point.
seedulongAn optional seed value to initialize the noise generation, defaulting to 0.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- float
A floating-point noise value in the range of -1 to 1.
Get4DNoise(ulong, ulong, ulong, ulong, ulong, NoiseType)
Generates a pseudo-random 4D noise value based on the specified coordinates and seed.
public static uint Get4DNoise(ulong x, ulong y, ulong z, ulong w, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe x-coordinate.
yulongThe y-coordinate.
zulongThe z-coordinate.
wulongThe w-coordinate.
seedulongThe seed used to initialize the noise generation. Default is 0.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- uint
A 32-bit unsigned integer representing the generated 4D noise value.
Get4DNoise01(ulong, ulong, ulong, ulong, ulong, NoiseType)
Generates 4D noise as a float value in the range [0, 1].
public static float Get4DNoise01(ulong x, ulong y, ulong z, ulong w, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe x-coordinate of the 4D noise.
yulongThe y-coordinate of the 4D noise.
zulongThe z-coordinate of the 4D noise.
wulongThe w-coordinate of the 4D noise.
seedulongThe seed value used for randomizing the noise generation. Defaults to 0 if not specified.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- float
A float value representing the 4D noise in the range [0, 1].
Get4DNoiseNeg1To1(ulong, ulong, ulong, ulong, ulong, NoiseType)
Generates a 4D noise value mapped to the range [-1, 1].
public static float Get4DNoiseNeg1To1(ulong x, ulong y, ulong z, ulong w, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xulongThe x-coordinate in the 4D space.
yulongThe y-coordinate in the 4D space.
zulongThe z-coordinate in the 4D space.
wulongThe w-coordinate in the 4D space.
seedulongThe seed value to control the noise generation.
typeNoiseTypeThe type of noise algorithm to apply, defined by the NoiseType enumeration.
Returns
- float
A floating-point noise value in the range [-1, 1].
GetCellSeed2D(int2, ulong, NoiseType)
Generates a 64-bit hash-based seed for a specified 2D cell coordinate using a given world seed and noise generation type.
public static ulong GetCellSeed2D(int2 cell, ulong worldSeed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
cellint2The 2D cell coordinate specified as an int2 structure, which determines the location for seed generation.
worldSeedulongAn optional 64-bit unsigned integer used to introduce additional randomness into the generated seed. Defaults to 0 if not specified.
typeNoiseTypeSpecifies the noise generation algorithm used to compute the seed, defaulting to MangledBitsBalancedMix.
Returns
- ulong
Returns a 64-bit unsigned integer representing the computed seed value for the specified 2D cell.
GetCellSeed3D(int3, ulong, NoiseType)
Computes a 64-bit noise value specific to a 3D cell location, based on the provided cell coordinates, world seed, and noise generation type.
public static ulong GetCellSeed3D(int3 cell, ulong worldSeed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
cellint3The 3D cell coordinates represented as an int3 structure, specifying the x, y, and z positions.
worldSeedulongA 64-bit unsigned integer seed applied to add randomness to the noise generation. Default is 0.
typeNoiseTypeThe noise generation type that determines the algorithm and mixing used for computation. Default is MangledBitsBalancedMix.
Returns
- ulong
A 64-bit unsigned integer representing the computed noise for the specified 3D cell.
GetUInt128(ulong, ulong, NoiseType)
Computes a 128-bit unsigned integer noise value consisting of two 64-bit parts, based on the provided index, seed, and noise generation type.
public static ulong2 GetUInt128(ulong index, ulong seed, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
indexulongThe index value used to compute the noise, influencing the position or state of the generated noise.
seedulongA 64-bit unsigned integer that adds randomness to the computed noise.
typeNoiseTypeThe noise generation type, which determines the method and mixing algorithm used for noise computation.
Returns
- ulong2
A 128-bit unsigned integer represented as a struct containing two 64-bit parts of computed noise.
GetUInt64(ulong, ulong, NoiseType)
Computes a 64-bit unsigned integer noise value based on the provided index, seed, and noise generation type.
public static ulong GetUInt64(ulong index, ulong seed, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
indexulongThe index value used to compute the noise, influencing the position or state of the generated noise.
seedulongA 64-bit unsigned integer that adds randomness to the computed noise.
typeNoiseTypeThe noise generation type, which determines the method and algorithm used for noise computation. Defaults to MangledBitsBalancedMix.
Returns
- ulong
A 64-bit unsigned integer representing the computed noise value.
GradientCentral(float2, ulong, float, NoiseType)
Computes the central gradient of a 2D Perlin noise function at a given position, using small directional offsets along the x and y axes.
public static float2 GradientCentral(float2 p, ulong seed, float eps = 0.001, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D position at which the gradient should be calculated.
seedulongA 64-bit unsigned integer value that provides randomness for the Perlin noise calculation.
epsfloatA small offset value used for finite difference calculations to approximate the derivatives. Default is 1e-3.
typeNoiseTypeThe noise generation type, determining the algorithm used for noise computation. Default is MangledBitsBalancedMix.
Returns
- float2
A float2 structure representing the gradient vector at the specified position, with x and y components calculated based on Perlin noise.
GradientCentral(float3, ulong, 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 a central difference with a small epsilon step size for numerical differentiation.
public static float3 GradientCentral(float3 p, ulong seed, float eps = 0.001, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The 3D point where the gradient is evaluated.
seedulongThe seed value used for noise generation, ensuring determinism.
epsfloatThe small step size used for central difference computation. The default is 1e-3f.
typeNoiseTypeThe type of noise function used, defaulting to MangledBitsBalancedMix.
Returns
Perlin(float, float, float, ulong, NoiseType)
Computes a Perlin noise value for a specific 3D point using optional settings for seed value and noise computation type.
public static float Perlin(float x, float y, float z, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xfloatThe X-coordinate of the input point in 3D space.
yfloatThe Y-coordinate of the input point in 3D space.
zfloatThe Z-coordinate of the input point in 3D space.
seedulongAn optional 64-bit unsigned seed value for adding randomness, defaulting to 0.
typeNoiseTypeAn optional noise type specifying the computation method, defaulting to a balanced mix.
Returns
- float
A single-precision floating-point value representing the computed Perlin noise at the given 3D coordinates.
Perlin(float, float, ulong, NoiseType)
Computes Perlin noise value for the specified 2D coordinates (x, y) using the given seed and noise type.
public static float Perlin(float x, float y, ulong seed = 0, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xfloatThe x-coordinate of the sample point in the 2D noise field.
yfloatThe y-coordinate of the sample point in the 2D noise field.
seedulongAn optional 64-bit unsigned integer seed providing additional randomness to the noise output. Defaults to 0.
typeNoiseTypeThe noise generation algorithm type used for computing the noise. Defaults to the system's default noise type.
Returns
- float
A single-precision floating-point value representing the computed Perlin noise at the specified coordinates.
PerlinWithDeriv(float, float, float, ulong, out float3, NoiseType)
Computes Perlin noise with derivatives for the given 3D position, seed, and noise generation type.
public static float PerlinWithDeriv(float x, float y, float z, ulong seed, out float3 d, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xfloatThe x-coordinate of the position in 3D space for noise computation.
yfloatThe y-coordinate of the position in 3D space for noise computation.
zfloatThe z-coordinate of the position in 3D space for noise computation.
seedulongA 64-bit unsigned integer seed value to control the randomness of the noise behavior.
dfloat3An output parameter representing the 3D gradient of the noise at the specified position.
typeNoiseTypeThe noise generation type determining how the noise and gradients are computed.
Returns
- float
A single-precision floating-point value representing the computed Perlin noise at the specified position.
PerlinWithDeriv(float, float, ulong, out float2, NoiseType)
Computes a Perlin noise value at the specified 2D coordinates with derivatives, based on the provided seed and noise type.
public static float PerlinWithDeriv(float x, float y, ulong seed, out float2 d, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xfloatThe X-coordinate of the input position.
yfloatThe Y-coordinate of the input position.
seedulongA 64-bit unsigned integer used as a randomization seed for the noise generation.
dfloat2An output parameter that contains the 2D derivatives of the noise in the X and Y directions.
typeNoiseTypeThe noise generation type, which defines the method used for noise computation and mixing.
Returns
- float
A floating-point value representing the computed Perlin noise at the specified coordinates.
Ridge(float3, ulong, 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, ulong 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
pfloat3The input 3D position for the noise function.
seedulongThe seed value to ensure determinism in the generation. Default is 0.
octavesintThe number of noise octaves used to compute the ridge noise. Default is 5.
frequencyfloatThe starting frequency for the noise generation. Default is 1f.
amplitudefloatThe starting amplitude for the noise generation. Default is 1f.
lacunarityfloatThe frequency multiplier applied after each octave. Default is 2f.
gainfloatThe amplitude multiplier applied after each octave. Default is 0.5f.
ridgeOffsetfloatThe offset applied to the ridge transformation. Default is 1.0f.
ridgeSharpnessfloatThe sharpness applied to the ridge calculation. Default is 2.0f.
normalizeboolA boolean flag indicating whether the resulting noise values should be normalized across the range [-1, 1]. Default is true.
typeNoiseTypeThe 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, ulong, float, NoiseType)
Computes a 2D Simplex noise value based on the specified position, seed, frequency, and noise type.
public static float Simplex2DCore(float2 position, ulong seed = 0, float frequency = 1, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
positionfloat2The 2D coordinates at which the noise value is to be computed.
seedulongA 64-bit unsigned integer used to initialize the random sequence for noise generation. Defaults to 0.
frequencyfloatA scaling factor that determines the spatial frequency of the noise. Defaults to 1.
typeNoiseTypeThe noise computation type, influencing the gradient mixing method. Defaults to DefaultNoiseType.
Returns
- float
A floating-point number representing the computed Simplex noise value, scaled to approximately the range [-1, 1].
Simplex3DCore(float3, ulong, float, NoiseType)
Calculates a 3D Simplex noise value at the given position using the specified seed, frequency, and noise type.
public static float Simplex3DCore(float3 position, ulong seed = 0, float frequency = 1, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
positionfloat3The 3D position at which to evaluate the noise function.
seedulongAn optional 64-bit unsigned integer to seed the noise generation, providing deterministic randomness.
frequencyfloatThe frequency of the noise, scaling the input position to control the level of detail.
typeNoiseTypeThe noise generation type, determining the method used for gradient computation and noise variation.
Returns
- float
A single-precision floating-point value representing the computed 3D Simplex noise.
UberNoise(float3, ulong, 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 
public static float UberNoise(float3 p, ulong 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
pfloat3The 3D position in space where the noise is evaluated.
seedulongA 64-bit unsigned integer used to initialize noise computation for added randomness. Default is 0.
octavesintThe number of layers of fractal Brownian motion applied. Default is 6.
frequencyfloatThe base frequency of the noise pattern. Default is 1.
lacunarityfloatThe scaling factor applied to the frequency for each octave. Default is 2.
gainfloatThe amplitude reduction factor for each successive octave. Default is 0.5.
warp1AmpfloatThe amplitude of the first domain warp. Default is 0.75.
warp1FreqfloatThe frequency of the first domain warp. Default is 0.5.
warp1OctintThe number of octaves used for the first domain warp. Default is 2.
warp2AmpfloatThe amplitude of the second domain warp. Default is 0.35.
warp2FreqfloatThe frequency of the second domain warp. Default is 1.2.
warp2OctintThe number of octaves used for the second domain warp. Default is 2.
ridgeMixfloatThe blend factor for mixing the ridged noise component with the primary noise. Default is 0.3.
typeNoiseTypeThe noise type used for all operations. Default is the predefined noise type.
Returns
- float
A floating-point value representing the computed noise, clamped within the range [-1, 1].
ValueAndGrad(float, float, ulong, 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, ulong seed, out float2 grad, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
xfloatThe x-coordinate of the input point.
yfloatThe y-coordinate of the input point.
seedulongA seed value for the noise generation.
gradfloat2An output parameter that returns the 2D gradient vector of the noise value at the input point.
typeNoiseTypeThe type of noise to use during computation.
Returns
- float
The Perlin noise value at the given 2D point.
ValueAndGrad(float2, ulong, out float2, NoiseType)
Computes the Perlin noise value at a given 2D coordinate, along with its gradient at that point, based on the provided seed and noise generation type.
public static float ValueAndGrad(float2 p, ulong seed, out float2 grad, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2A 2D coordinate represented as a float2 structure, specifying the point for which the noise value and gradient are computed.
seedulongA 64-bit unsigned integer that introduces randomness into the noise generation process.
gradfloat2An output parameter that stores the computed gradient as a float2 structure for the given 2D point.
typeNoiseTypeThe noise generation type, determining the algorithm and mixing method used for computing the noise value and gradient.
Returns
- float
A single-precision floating-point value representing the computed Perlin noise at the specified 2D coordinate.
ValueAndGrad(float3, ulong, out float3, NoiseType)
Computes the Perlin noise value at the given point and calculates its gradient.
public static float ValueAndGrad(float3 p, ulong seed, out float3 grad, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The input position represented as a 3D vector.
seedulongThe seed value used to ensure deterministic noise generation.
gradfloat3The resulting gradient of the Perlin noise at the specified position.
typeNoiseTypeThe type of noise to be used for computation.
Returns
- float
Returns the Perlin noise value at the given position.
WorleyBlocky2D(float2, ulong, float, float, CellularDistance, float, NoiseType)
Computes a 2D blocky Worley noise value based on the provided parameters. This function evaluates cellular noise and generates smooth transitions influenced by jitter and distance metrics. Defaults: Chebyshev, jitter=0.1, freq=0.01, edgeWidth=0.1.
public static float WorleyBlocky2D(float2 p, ulong seed = 0, float frequency = 0.01, float jitter = 0.1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Chebyshev, float edgeWidth = 0.1, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D position in space where the noise value will be sampled.
seedulongA 64-bit unsigned integer that introduces randomness to the noise generation process.
frequencyfloatDetermines the frequency or “scale” of the noise pattern. Smaller values spread noise features further apart.
jitterfloatControls the variability of the cell center points, affecting the randomness of the generated pattern.
metricHashBasedNoiseUtils.CellularDistanceSpecifies the distance metric used to calculate the cellular noise, influencing the shape of the noise cells.
edgeWidthfloatDefines the thickness of the edges between the noise cells. Higher values result in thicker transitions.
typeNoiseTypeThe noise generation type, impacting internal computation and mixing operations for noise synthesis.
Returns
- float
A floating-point value representing the computed 2D Worley blocky noise at the specified position.
WorleyBlocky3D(float3, ulong, float, float, CellularDistance, float, NoiseType)
Computes a 3D blocky Worley noise value based on the given input parameters, allowing customization of frequency, jitter, distance metrics, and edge width.
public static float WorleyBlocky3D(float3 p, ulong seed = 0, float frequency = 0.012, float jitter = 0.1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Chebyshev, float edgeWidth = 0.12, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The 3D position at which the Worley noise is evaluated, represented as a float3.
seedulongThe base seed used for randomization, influencing variability in noise generation. Defaults to 0 if unspecified.
frequencyfloatThe frequency of the noise, controlling the scale and number of cells in 3D space. Defaults to 0.012f if unspecified.
jitterfloatThe amount of randomness applied to cell points, ranging from 0 (no jitter) to higher values increasing randomness. Defaults to 0.1f.
metricHashBasedNoiseUtils.CellularDistanceThe cellular distance metric used when determining proximity, such as Euclidean, Manhattan, or Chebyshev. Defaults to Chebyshev.
edgeWidthfloatThe width of the edges between cells, controlling transition smoothness between cell boundaries. Defaults to 0.12f.
typeNoiseTypeThe noise generation type that determines the mixing algorithm used during computation. Defaults to MangledBitsBalancedMix.
Returns
- float
A floating-point value representing the computed Worley 3D noise, ranging within [-1, 1].
WorleyWormy2D(float2, ulong, float, float, CellularDistance, float, NoiseType)
Generates a 2D Worley noise value based on the provided parameters, with additional control over frequency, jitter, and edge width.
public static float WorleyWormy2D(float2 p, ulong seed = 0, float frequency = 0.005, float jitter = 1, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.1, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat2The 2D position for which the noise value is computed.
seedulongA 64-bit unsigned integer used to introduce randomness into the noise computation. Default is 0.
frequencyfloatThe frequency of the noise pattern, determining the scale or repetition of features. Default is 0.005f.
jitterfloatThe level of randomness applied to cell points, affecting the distortion of the noise. Default is 1.0f.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used for computation, defining how distances between points are measured (e.g., Euclidean). Default is Euclidean.
edgeWidthfloatThe width of the edges in the noise pattern, controlling the interpolation around cellular boundaries. Default is 0.1f.
typeNoiseTypeThe noise generation type, dictating the method and mixing algorithm used in the calculation. Default is MangledBitsBalancedMix.
Returns
- float
A floating-point value representing the computed 2D Worley noise at the specified position and parameters.
WorleyWormy3D(float3, ulong, float, float, CellularDistance, float, NoiseType)
Generates a 3D cellular noise value with additional control over frequency, jitter, edge width, and distance metric, customized for a “Worley Wormy” effect.
public static float WorleyWormy3D(float3 p, ulong seed = 0, float frequency = 0.006, float jitter = 0.9, HashBasedNoiseUtils.CellularDistance metric = CellularDistance.Euclidean, float edgeWidth = 0.12, NoiseType type = NoiseType.MangledBitsBalancedMix)
Parameters
pfloat3The 3D coordinate at which to evaluate the noise.
seedulongAn optional seed for randomness to ensure variation in noise generation.
frequencyfloatThe frequency of the noise, controlling its scale and detail.
jitterfloatControls the randomness of feature-point distribution within grid cells.
metricHashBasedNoiseUtils.CellularDistanceThe distance metric used to compute cell distances, influencing the noise pattern.
edgeWidthfloatThe width of the transition between cells, affecting the sharpness or smoothness of edges.
typeNoiseTypeSpecifies the noise generation type, determining the algorithm used for computation.
Returns
- float
A float value representing the 3D noise at the given coordinate, customized with the provided parameters.