FastNoise2
Wrapper for the FastNoise2(https://github.com/Auburn/FastNoise2) library.
Wrapper for the FastNoise2(https://github.com/Auburn/FastNoise2) library.
Generates coherent noise with support for SIMD processing, which can speed up generation significantly compared to scalar implementations like FastNoiseLite.
It uses a node-based structure internally for configuration, which is however not editable from within Reckfell at the moment. Instead, simplified properties are exposed. It possible to edit noise graphs with an external Noise Tool, which can export an encoded node tree as a base64 string.
The current integration uses FastNoise2 version 0.10.0-alpha. If you use encoded node trees made with the Noise Tool, it must match that version.
After changing properties, you must call FastNoise2.UpdateGenerator for the internal graph to be rebuilt and changes to take effect.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
FastNoise2Constructor
public FastNoise2();Properties22
CellularDistanceFunctionProperty
public FastNoise2.CellularDistanceFunctionEnum CellularDistanceFunction { get; set; }CellularIndex0Property
public int CellularIndex0 { get; set; }N-th closest cell used in cellular distance or value calculations.
CellularIndex1Property
public int CellularIndex1 { get; set; }N-th closest cell used as second component in some cellular distance calculations.
CellularJitterProperty
public float CellularJitter { get; set; }CellularReturnTypeProperty
public FastNoise2.CellularReturnTypeEnum CellularReturnType { get; set; }EncodedNodeTreeProperty
public string EncodedNodeTree { get; set; }FractalGainProperty
public float FractalGain { get; set; }FractalLacunarityProperty
public float FractalLacunarity { get; set; }FractalOctavesProperty
public int FractalOctaves { get; set; }FractalPingPongStrengthProperty
public float FractalPingPongStrength { get; set; }FractalTypeProperty
public FastNoise2.FractalTypeEnum FractalType { get; set; }NoiseTypeProperty
public FastNoise2.NoiseTypeEnum NoiseType { get; set; }PeriodProperty
public float Period { get; set; }RemapEnabledProperty
public bool RemapEnabled { get; set; }RemapInputMaxProperty
public float RemapInputMax { get; set; }RemapInputMinProperty
public float RemapInputMin { get; set; }RemapOutputMaxProperty
public float RemapOutputMax { get; set; }RemapOutputMinProperty
public float RemapOutputMin { get; set; }SeedProperty
public int Seed { get; set; }TerraceEnabledProperty
public bool TerraceEnabled { get; set; }TerraceMultiplierProperty
public float TerraceMultiplier { get; set; }TerraceSmoothnessProperty
public float TerraceSmoothness { get; set; }Methods50
GenerateImagevoid
public void GenerateImage(Image image, bool tileable);Fills a greyscale image with noise values.
| Name | Type | Default |
|---|---|---|
image | Image | — |
tileable | bool | — |
GetCellularDistanceFunctionFastNoise2.CellularDistanceFunctionEnum
public FastNoise2.CellularDistanceFunctionEnum GetCellularDistanceFunction();FastNoise2.CellularDistanceFunctionEnumGetCellularIndex0int
public int GetCellularIndex0();intGetCellularIndex1int
public int GetCellularIndex1();intGetCellularJitterfloat
public float GetCellularJitter();floatGetCellularReturnTypeFastNoise2.CellularReturnTypeEnum
public FastNoise2.CellularReturnTypeEnum GetCellularReturnType();FastNoise2.CellularReturnTypeEnumGetEncodedNodeTreestring
public string GetEncodedNodeTree();stringGetFractalGainfloat
public float GetFractalGain();floatGetFractalLacunarityfloat
public float GetFractalLacunarity();floatGetFractalOctavesint
public int GetFractalOctaves();intGetFractalPingPongStrengthfloat
public float GetFractalPingPongStrength();floatGetFractalTypeFastNoise2.FractalTypeEnum
public FastNoise2.FractalTypeEnum GetFractalType();FastNoise2.FractalTypeEnumGetNoise2DSinglefloat
public float GetNoise2DSingle(Vector2 pos);Generates a single value of 2D noise. Note that generating values one by one will not benefit from SIMD performance as much as generating multiple values at once.
| Name | Type | Default |
|---|---|---|
pos | Vector2 | — |
floatGetNoise3DSinglefloat
public float GetNoise3DSingle(Vector3 pos);Generates a single value of 3D noise. Note that generating values one by one will not benefit from SIMD performance as much as generating multiple values at once.
| Name | Type | Default |
|---|---|---|
pos | Vector3 | — |
floatGetNoiseTypeFastNoise2.NoiseTypeEnum
public FastNoise2.NoiseTypeEnum GetNoiseType();FastNoise2.NoiseTypeEnumGetPeriodfloat
public float GetPeriod();floatGetRemapInputMaxfloat
public float GetRemapInputMax();floatGetRemapInputMinfloat
public float GetRemapInputMin();floatGetRemapOutputMaxfloat
public float GetRemapOutputMax();floatGetRemapOutputMinfloat
public float GetRemapOutputMin();floatGetSeedint
public int GetSeed();intGetSimdLevelFastNoise2.SimdLevel
public FastNoise2.SimdLevel GetSimdLevel();Gets which SIMD level was detected by the library. This gives an indication of performance on the current CPU, as different models can have different SIMD instructions available.
FastNoise2.SimdLevelGetSimdLevelNamestring
public static string GetSimdLevelName(FastNoise2.SimdLevel level);Gets the name of SIMD level.
| Name | Type | Default |
|---|---|---|
level | FastNoise2.SimdLevel | — |
stringGetTerraceMultiplierfloat
public float GetTerraceMultiplier();floatGetTerraceSmoothnessfloat
public float GetTerraceSmoothness();floatIsRemapEnabledbool
public bool IsRemapEnabled();boolIsTerraceEnabledbool
public bool IsTerraceEnabled();boolSetCellularDistanceFunctionvoid
public void SetCellularDistanceFunction(FastNoise2.CellularDistanceFunctionEnum cellDistanceFunc);| Name | Type | Default |
|---|---|---|
cellDistanceFunc | FastNoise2.CellularDistanceFunctionEnum | — |
SetCellularIndex0void
public void SetCellularIndex0(int i);| Name | Type | Default |
|---|---|---|
i | int | — |
SetCellularIndex1void
public void SetCellularIndex1(int i);| Name | Type | Default |
|---|---|---|
i | int | — |
SetCellularJittervoid
public void SetCellularJitter(float returnType);| Name | Type | Default |
|---|---|---|
returnType | float | — |
SetCellularReturnTypevoid
public void SetCellularReturnType(FastNoise2.CellularReturnTypeEnum returnType);| Name | Type | Default |
|---|---|---|
returnType | FastNoise2.CellularReturnTypeEnum | — |
SetEncodedNodeTreevoid
public void SetEncodedNodeTree(string code);| Name | Type | Default |
|---|---|---|
code | string | — |
SetFractalGainvoid
public void SetFractalGain(float gain);| Name | Type | Default |
|---|---|---|
gain | float | — |
SetFractalLacunarityvoid
public void SetFractalLacunarity(float lacunarity);| Name | Type | Default |
|---|---|---|
lacunarity | float | — |
SetFractalOctavesvoid
public void SetFractalOctaves(int octaves);| Name | Type | Default |
|---|---|---|
octaves | int | — |
SetFractalPingPongStrengthvoid
public void SetFractalPingPongStrength(float strength);| Name | Type | Default |
|---|---|---|
strength | float | — |
SetFractalTypevoid
public void SetFractalType(FastNoise2.FractalTypeEnum type);| Name | Type | Default |
|---|---|---|
type | FastNoise2.FractalTypeEnum | — |
SetNoiseTypevoid
public void SetNoiseType(FastNoise2.NoiseTypeEnum type);| Name | Type | Default |
|---|---|---|
type | FastNoise2.NoiseTypeEnum | — |
SetPeriodvoid
public void SetPeriod(float period);| Name | Type | Default |
|---|---|---|
period | float | — |
SetRemapEnabledvoid
public void SetRemapEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetRemapInputMaxvoid
public void SetRemapInputMax(float maxValue);| Name | Type | Default |
|---|---|---|
maxValue | float | — |
SetRemapInputMinvoid
public void SetRemapInputMin(float minValue);| Name | Type | Default |
|---|---|---|
minValue | float | — |
SetRemapOutputMaxvoid
public void SetRemapOutputMax(float maxValue);| Name | Type | Default |
|---|---|---|
maxValue | float | — |
SetRemapOutputMinvoid
public void SetRemapOutputMin(float minValue);| Name | Type | Default |
|---|---|---|
minValue | float | — |
SetSeedvoid
public void SetSeed(int seed);| Name | Type | Default |
|---|---|---|
seed | int | — |
SetTerraceEnabledvoid
public void SetTerraceEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetTerraceMultipliervoid
public void SetTerraceMultiplier(float multiplier);| Name | Type | Default |
|---|---|---|
multiplier | float | — |
SetTerraceSmoothnessvoid
public void SetTerraceSmoothness(float smoothness);| Name | Type | Default |
|---|---|---|
smoothness | float | — |
UpdateGeneratorvoid
public void UpdateGenerator();This method must be called after you change properties, so they can take effect.
FastNoise2.CellularDistanceFunctionEnum
| Value | Description |
|---|---|
Euclidean = 0 | |
EuclideanSq = 1 | |
Hybrid = 3 | |
Manhattan = 2 | |
MaxAxis = 4 |
FastNoise2.CellularReturnTypeEnum
FastNoise2.FractalTypeEnum
| Value | Description |
|---|---|
Fbm = 1 | |
None = 0 | |
PingPong = 3 | |
Ridged = 2 |
FastNoise2.NoiseTypeEnum
FastNoise2.SimdLevel
| Value | Description |
|---|---|
Avx = 128 | x86 CPU Processing 8 floats in one instruction. |
Avx2 = 256 | x86 CPU Processing 8 floats in one instruction, with more instructions supported than AVX. |
Avx512 = 512 | x86 CPU Processing 16 floats in one instruction. |
Neon = 65536 | ARM CPU processing 4 floats in one instruction. |
Null = 0 | Undefined level. |
Scalar = 1 | Single numbers. Slowest level. |
Sse = 2 | x86 CPU processing 4 floats in one instruction. |
Sse2 = 4 | x86 CPU Processing 4 floats in one instruction, with more instructions supported than SSE. |
Sse3 = 8 | x86 CPU Processing 4 floats in one instruction, with more instructions supported than SSE3. |
Sse41 = 32 | x86 CPU Processing 4 floats in one instruction, with more instructions supported than SSE41. |
Sse42 = 64 | x86 CPU Processing 4 floats in one instruction, with more instructions supported than SSE42. |
Ssse3 = 16 | x86 CPU Processing 4 floats in one instruction, with more instructions supported than SSE4. |