-
Notifications
You must be signed in to change notification settings - Fork 1
Home
PerduGames edited this page Dec 21, 2017
·
5 revisions
gdfastnoisesimd is a Godot 3.0 module for the FastNoiseSIMD lib.
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)