FastNoiseLite

package
v0.0.0-...-9b8b246 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

This class generates noise using the FastNoiseLite library, which is a collection of several noise algorithms including Cellular, Perlin, Value, and more.

Most generated noise values are in the range of [-1, 1], but not always. Some of the cellular noise algorithms return results above 1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsFastNoiseLite() Instance
}

type CellularDistanceFunction

type CellularDistanceFunction int //gd:FastNoiseLite.CellularDistanceFunction
const (
	// Euclidean distance to the nearest point.
	DistanceEuclidean CellularDistanceFunction = 0
	// Squared Euclidean distance to the nearest point.
	DistanceEuclideanSquared CellularDistanceFunction = 1
	// Manhattan distance (taxicab metric) to the nearest point.
	DistanceManhattan CellularDistanceFunction = 2
	// Blend of [DistanceEuclidean] and [DistanceManhattan] to give curved cell boundaries.
	DistanceHybrid CellularDistanceFunction = 3
)

type CellularReturnType

type CellularReturnType int //gd:FastNoiseLite.CellularReturnType
const (
	// The cellular distance function will return the same value for all points within a cell.
	ReturnCellValue CellularReturnType = 0
	// The cellular distance function will return a value determined by the distance to the nearest point.
	ReturnDistance CellularReturnType = 1
	// The cellular distance function returns the distance to the second-nearest point.
	ReturnDistance2 CellularReturnType = 2
	// The distance to the nearest point is added to the distance to the second-nearest point.
	ReturnDistance2Add CellularReturnType = 3
	// The distance to the nearest point is subtracted from the distance to the second-nearest point.
	ReturnDistance2Sub CellularReturnType = 4
	// The distance to the nearest point is multiplied with the distance to the second-nearest point.
	ReturnDistance2Mul CellularReturnType = 5
	// The distance to the nearest point is divided by the distance to the second-nearest point.
	ReturnDistance2Div CellularReturnType = 6
)

type DomainWarpFractalType

type DomainWarpFractalType int //gd:FastNoiseLite.DomainWarpFractalType
const (
	// No fractal noise for warping the space.
	DomainWarpFractalNone DomainWarpFractalType = 0
	// Warping the space progressively, octave for octave, resulting in a more "liquified" distortion.
	DomainWarpFractalProgressive DomainWarpFractalType = 1
	// Warping the space independently for each octave, resulting in a more chaotic distortion.
	DomainWarpFractalIndependent DomainWarpFractalType = 2
)

type DomainWarpType

type DomainWarpType int //gd:FastNoiseLite.DomainWarpType
const (
	// The domain is warped using the simplex noise algorithm.
	DomainWarpSimplex DomainWarpType = 0
	// The domain is warped using a simplified version of the simplex noise algorithm.
	DomainWarpSimplexReduced DomainWarpType = 1
	// The domain is warped using a simple noise grid (not as smooth as the other methods, but more performant).
	DomainWarpBasicGrid DomainWarpType = 2
)

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsFastNoiseLite

func (self *Extension[T]) AsFastNoiseLite() Instance

func (*Extension[T]) AsNoise

func (self *Extension[T]) AsNoise() Noise.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

type FractalType

type FractalType int //gd:FastNoiseLite.FractalType
const (
	// No fractal noise.
	FractalNone FractalType = 0
	// Method using Fractional Brownian Motion to combine octaves into a fractal.
	FractalFbm FractalType = 1
	// Method of combining octaves into a fractal resulting in a "ridged" look.
	FractalRidged FractalType = 2
	// Method of combining octaves into a fractal with a ping pong effect.
	FractalPingPong FractalType = 3
)

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.FastNoiseLite

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsFastNoiseLite

func (self Instance) AsFastNoiseLite() Instance

func (Instance) AsNoise

func (self Instance) AsNoise() Noise.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) CellularDistanceFunction

func (self Instance) CellularDistanceFunction() CellularDistanceFunction

Determines how the distance to the nearest/second-nearest point is computed.

func (Instance) CellularJitter

func (self Instance) CellularJitter() Float.X

Maximum distance a point can move off of its grid position. Set to 0 for an even grid.

func (Instance) CellularReturnType

func (self Instance) CellularReturnType() CellularReturnType

Return type from cellular noise calculations.

func (Instance) DomainWarpAmplitude

func (self Instance) DomainWarpAmplitude() Float.X

Sets the maximum warp distance from the origin.

func (Instance) DomainWarpEnabled

func (self Instance) DomainWarpEnabled() bool

If enabled, another FastNoiseLite instance is used to warp the space, resulting in a distortion of the noise.

func (Instance) DomainWarpFractalGain

func (self Instance) DomainWarpFractalGain() Float.X

Determines the strength of each subsequent layer of the noise which is used to warp the space.

A low value places more emphasis on the lower frequency base layers, while a high value puts more emphasis on the higher frequency layers.

func (Instance) DomainWarpFractalLacunarity

func (self Instance) DomainWarpFractalLacunarity() Float.X

The change in frequency between octaves, also known as "lacunarity", of the fractal noise which warps the space. Increasing this value results in higher octaves, producing noise with finer details and a rougher appearance.

func (Instance) DomainWarpFractalOctaves

func (self Instance) DomainWarpFractalOctaves() int

The number of noise layers that are sampled to get the final value for the fractal noise which warps the space.

func (Instance) DomainWarpFractalType

func (self Instance) DomainWarpFractalType() DomainWarpFractalType

The method for combining octaves into a fractal which is used to warp the space.

func (Instance) DomainWarpFrequency

func (self Instance) DomainWarpFrequency() Float.X

Frequency of the noise which warps the space. Low frequency results in smooth noise while high frequency results in rougher, more granular noise.

func (Instance) DomainWarpType

func (self Instance) DomainWarpType() DomainWarpType

The warp algorithm.

func (Instance) FractalGain

func (self Instance) FractalGain() Float.X

Determines the strength of each subsequent layer of noise in fractal noise.

A low value places more emphasis on the lower frequency base layers, while a high value puts more emphasis on the higher frequency layers.

func (Instance) FractalLacunarity

func (self Instance) FractalLacunarity() Float.X

Frequency multiplier between subsequent octaves. Increasing this value results in higher octaves producing noise with finer details and a rougher appearance.

func (Instance) FractalOctaves

func (self Instance) FractalOctaves() int

The number of noise layers that are sampled to get the final value for fractal noise types.

func (Instance) FractalPingPongStrength

func (self Instance) FractalPingPongStrength() Float.X

Sets the strength of the fractal ping pong type.

func (Instance) FractalType

func (self Instance) FractalType() FractalType

The method for combining octaves into a fractal.

func (Instance) FractalWeightedStrength

func (self Instance) FractalWeightedStrength() Float.X

Higher weighting means higher octaves have less impact if lower octaves have a large impact.

func (Instance) Frequency

func (self Instance) Frequency() Float.X

The frequency for all noise types. Low frequency results in smooth noise while high frequency results in rougher, more granular noise.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) NoiseType

func (self Instance) NoiseType() NoiseType

The noise algorithm used.

func (Instance) Offset

func (self Instance) Offset() Vector3.XYZ

Translate the noise input coordinates by the given Vector3.XYZ.

func (Instance) Seed

func (self Instance) Seed() int

The random number seed for all noise types.

func (Instance) SetCellularDistanceFunction

func (self Instance) SetCellularDistanceFunction(value CellularDistanceFunction)

SetCellularDistanceFunction sets the property returned by [GetCellularDistanceFunction].

func (Instance) SetCellularJitter

func (self Instance) SetCellularJitter(value Float.X)

SetCellularJitter sets the property returned by [GetCellularJitter].

func (Instance) SetCellularReturnType

func (self Instance) SetCellularReturnType(value CellularReturnType)

SetCellularReturnType sets the property returned by [GetCellularReturnType].

func (Instance) SetDomainWarpAmplitude

func (self Instance) SetDomainWarpAmplitude(value Float.X)

SetDomainWarpAmplitude sets the property returned by [GetDomainWarpAmplitude].

func (Instance) SetDomainWarpEnabled

func (self Instance) SetDomainWarpEnabled(value bool)

SetDomainWarpEnabled sets the property returned by [IsDomainWarpEnabled].

func (Instance) SetDomainWarpFractalGain

func (self Instance) SetDomainWarpFractalGain(value Float.X)

SetDomainWarpFractalGain sets the property returned by [GetDomainWarpFractalGain].

func (Instance) SetDomainWarpFractalLacunarity

func (self Instance) SetDomainWarpFractalLacunarity(value Float.X)

SetDomainWarpFractalLacunarity sets the property returned by [GetDomainWarpFractalLacunarity].

func (Instance) SetDomainWarpFractalOctaves

func (self Instance) SetDomainWarpFractalOctaves(value int)

SetDomainWarpFractalOctaves sets the property returned by [GetDomainWarpFractalOctaves].

func (Instance) SetDomainWarpFractalType

func (self Instance) SetDomainWarpFractalType(value DomainWarpFractalType)

SetDomainWarpFractalType sets the property returned by [GetDomainWarpFractalType].

func (Instance) SetDomainWarpFrequency

func (self Instance) SetDomainWarpFrequency(value Float.X)

SetDomainWarpFrequency sets the property returned by [GetDomainWarpFrequency].

func (Instance) SetDomainWarpType

func (self Instance) SetDomainWarpType(value DomainWarpType)

SetDomainWarpType sets the property returned by [GetDomainWarpType].

func (Instance) SetFractalGain

func (self Instance) SetFractalGain(value Float.X)

SetFractalGain sets the property returned by [GetFractalGain].

func (Instance) SetFractalLacunarity

func (self Instance) SetFractalLacunarity(value Float.X)

SetFractalLacunarity sets the property returned by [GetFractalLacunarity].

func (Instance) SetFractalOctaves

func (self Instance) SetFractalOctaves(value int)

SetFractalOctaves sets the property returned by [GetFractalOctaves].

func (Instance) SetFractalPingPongStrength

func (self Instance) SetFractalPingPongStrength(value Float.X)

SetFractalPingPongStrength sets the property returned by [GetFractalPingPongStrength].

func (Instance) SetFractalType

func (self Instance) SetFractalType(value FractalType)

SetFractalType sets the property returned by [GetFractalType].

func (Instance) SetFractalWeightedStrength

func (self Instance) SetFractalWeightedStrength(value Float.X)

SetFractalWeightedStrength sets the property returned by [GetFractalWeightedStrength].

func (Instance) SetFrequency

func (self Instance) SetFrequency(value Float.X)

SetFrequency sets the property returned by [GetFrequency].

func (Instance) SetNoiseType

func (self Instance) SetNoiseType(value NoiseType)

SetNoiseType sets the property returned by [GetNoiseType].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOffset

func (self Instance) SetOffset(value Vector3.XYZ)

SetOffset sets the property returned by [GetOffset].

func (Instance) SetSeed

func (self Instance) SetSeed(value int)

SetSeed sets the property returned by [GetSeed].

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type NoiseType

type NoiseType int //gd:FastNoiseLite.NoiseType
const (
	// A lattice of points are assigned random values then interpolated based on neighboring values.
	TypeValue NoiseType = 5
	// Similar to value noise ([TypeValue]), but slower. Has more variance in peaks and valleys.
	//
	// Cubic noise can be used to avoid certain artifacts when using value noise to create a bumpmap. In general, you should always use this mode if the value noise is being used for a heightmap or bumpmap.
	TypeValueCubic NoiseType = 4
	// A lattice of random gradients. Their dot products are interpolated to obtain values in between the lattices.
	TypePerlin NoiseType = 3
	// Cellular includes both Worley noise and Voronoi diagrams which creates various regions of the same value.
	TypeCellular NoiseType = 2
	// As opposed to [TypePerlin], gradients exist in a simplex lattice rather than a grid lattice, avoiding directional artifacts. Internally uses FastNoiseLite's OpenSimplex2 noise type.
	TypeSimplex NoiseType = 0
	// Modified, higher quality version of [TypeSimplex], but slower. Internally uses FastNoiseLite's OpenSimplex2S noise type.
	TypeSimplexSmooth NoiseType = 1
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL