gdfastnoisesimd is a Godot 3.0 module for the FastNoiseSIMD lib. Thanks to @Auburns.
FastNoiseSIMD is a library for noise generation that uses SIMD(Single Instruction, Multiple Data) instructions.
If you are having problems compiling or getting errors while using the library in Godot, try commenting the line #define FN_COMPILE_AVX2 in the file FastNoiseSIMD.h which is inside the FastNoiseSIMD directory in the gdfastnoisesimd module (Probably already be commented out by default).
extends Node
var noise = GDFastNoiseSIMD.new()
func _ready():
# Choose a seed to generate the noise. The results will be different for different seeds.
noise.setSeed(16549)
# Choose the type of noise.
noise.setNoiseType(noise.SIMPLEX)
# Always returns a one-dimensional float array.
# If the size of the Z dimension is a multiple of 8 there is a slight performance boost.
var arrayFloat = noise.getNoiseSet(0, 0, 0, 16, 16, 16)
# All outputs are approximately bounded from -1.0 to 1.0, except for distance functions on cellular noise.
print(arrayFloat)
# 2D noise
var otherArrayFloat = noise.getNoiseSet(0, 0, 0, 1, 16, 16)
print(otherArrayFloat)
# You can also call the specific noise function.
# Check out the DOC/API for all available functions.
var arrayFloatPerlin = noise.getPerlinFractalSet(0, 0, 0, 16, 16, 16)
print(arrayFloatPerlin)
# NoiseTypes
VALUE
VALUE_FRACTAL
PERLIN
PERLIN_FRACTAL
SIMPLEX
SIMPLEX_FRACTAL
WHITENOISE
CELULAR
CUBIC
CUBIC_FRACTAL
# FractalTypes
FBM
BILLOW
RIGIDMULTI
# CellularDistanceFunction
EUCLIDEAN
MANHATTAN
NATURAL
# CellularReturnType
CELLVALUE
DISTANCE
DISTANCE2
DISTANCE2ADD
DISTANCE2SUB
DISTANCE2MUL
DISTANCE2DIV
NOISELOOKUP
DISTANCE2CAVE
# PerturbType
NONE
GRADIENT
GRADIENTFRACTAL
NORMALISE
GRADIENT_NORMALISE
GRADIENTFRACTAL_NORMALISE
PoolRealArray getNoiseSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getWhiteNoiseSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getValueSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getValueFractalSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getPerlinSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getPerlinFractalSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getSimplexSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getSimplexFractalSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getCellularSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getCubicSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
PoolRealArray getCubicFractalSet(int xStart, int yStart, int zStart, int xSize, int ySize, int zSize, float scaleModifier=1.0f)
gdfastnoisesimd
is under MIT License.
If you need some function that is not in the module, create an issue stating that you need it.