Index · Object → RefCounted → Resource → Noise → FastNoiseLite

FastNoiseLite

Generates noise using the FastNoiseLite library.

Class Description

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.

Properties

var cellular_distance_function: FastNoiseLite.CellularDistanceFunction = 0

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

var cellular_jitter: float = 1.0

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

var cellular_return_type: FastNoiseLite.CellularReturnType = 1

Return type from cellular noise calculations.

var domain_warp_amplitude: float = 30.0

Sets the maximum warp distance from the origin.

var domain_warp_enabled: bool = false

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

var domain_warp_fractal_gain: float = 0.5

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.

var domain_warp_fractal_lacunarity: float = 6.0

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.

var domain_warp_fractal_octaves: int = 5

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

var domain_warp_fractal_type: FastNoiseLite.DomainWarpFractalType = 1

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

var domain_warp_frequency: float = 0.05

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

var domain_warp_type: FastNoiseLite.DomainWarpType = 0

The warp algorithm.

var fractal_gain: float = 0.5

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.

var fractal_lacunarity: float = 2.0

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

var fractal_octaves: int = 5

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

var fractal_ping_pong_strength: float = 2.0

Sets the strength of the fractal ping pong type.

var fractal_type: FastNoiseLite.FractalType = 1

The method for combining octaves into a fractal.

var fractal_weighted_strength: float = 0.0

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

var frequency: float = 0.01

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

var noise_type: FastNoiseLite.NoiseType = 1

The noise algorithm used.

var offset: Vector3 = Vector3(0, 0, 0)

Translate the noise input coordinates by the given Vector3.

var seed: int = 0

The random number seed for all noise types.

Inherited from Resource (4)

Methods

Inherited from Noise (9)
func get_image(width: int, height: int, invert: bool = false, in_3d_space: bool = false, normalize: bool = true) -> Image
func get_image_3d(width: int, height: int, depth: int, invert: bool = false, normalize: bool = true) -> Image[]
func get_noise_2d(x: float, y: float) -> float
func get_noise_3d(x: float, y: float, z: float) -> float
func get_seamless_image(width: int, height: int, invert: bool = false, in_3d_space: bool = false, skirt: float = 0.1, normalize: bool = true) -> Image
func get_seamless_image_3d(width: int, height: int, depth: int, invert: bool = false, skirt: float = 0.1, normalize: bool = true) -> Image[]
Inherited from Resource (18)
func _get_rid() -> RID
func _reset_state() -> void
func _set_path_cache(path: String) -> void
func _setup_local_to_scene() -> void
func copy_from_resource(resource: Resource) -> Error
func duplicate(deep: bool = false) -> Resource
func duplicate_deep(deep_subresources_mode: Resource.DeepDuplicateMode = 1) -> Resource
func emit_changed() -> void
func get_rid() -> RID
func is_built_in() -> bool
func reset_state() -> void
func set_id_for_path(path: String, id: String) -> void
func set_path_cache(path: String) -> void
func setup_local_to_scene() -> void
func take_over_path(path: String) -> void
Inherited from RefCounted (4)
func init_ref() -> bool
func reference() -> bool
func unreference() -> bool
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

Inherited from Resource (2)
signal changed()
Inherited from Object (2)

Enums & Constants

enum NoiseType
TYPE_VALUE = 5

A lattice of points are assigned random values then interpolated based on neighboring values.

TYPE_VALUE_CUBIC = 4

Similar to value noise (TYPE_VALUE), 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.

TYPE_PERLIN = 3

A lattice of random gradients. Their dot products are interpolated to obtain values in between the lattices.

TYPE_CELLULAR = 2

Cellular includes both Worley noise and Voronoi diagrams which creates various regions of the same value.

TYPE_SIMPLEX = 0

As opposed to TYPE_PERLIN, gradients exist in a simplex lattice rather than a grid lattice, avoiding directional artifacts. Internally uses FastNoiseLite's OpenSimplex2 noise type.

TYPE_SIMPLEX_SMOOTH = 1

Modified, higher quality version of TYPE_SIMPLEX, but slower. Internally uses FastNoiseLite's OpenSimplex2S noise type.

enum FractalType
FRACTAL_NONE = 0

No fractal noise.

FRACTAL_FBM = 1

Method using Fractional Brownian Motion to combine octaves into a fractal.

FRACTAL_RIDGED = 2

Method of combining octaves into a fractal resulting in a "ridged" look.

FRACTAL_PING_PONG = 3

Method of combining octaves into a fractal with a ping pong effect.

enum CellularDistanceFunction
DISTANCE_EUCLIDEAN = 0

Euclidean distance to the nearest point.

DISTANCE_EUCLIDEAN_SQUARED = 1

Squared Euclidean distance to the nearest point.

DISTANCE_MANHATTAN = 2

Manhattan distance (taxicab metric) to the nearest point.

DISTANCE_HYBRID = 3

Blend of DISTANCE_EUCLIDEAN and DISTANCE_MANHATTAN to give curved cell boundaries.

enum CellularReturnType
RETURN_CELL_VALUE = 0

The cellular distance function will return the same value for all points within a cell.

RETURN_DISTANCE = 1

The cellular distance function will return a value determined by the distance to the nearest point.

RETURN_DISTANCE2 = 2

The cellular distance function returns the distance to the second-nearest point.

RETURN_DISTANCE2_ADD = 3

The distance to the nearest point is added to the distance to the second-nearest point.

RETURN_DISTANCE2_SUB = 4

The distance to the nearest point is subtracted from the distance to the second-nearest point.

RETURN_DISTANCE2_MUL = 5

The distance to the nearest point is multiplied with the distance to the second-nearest point.

RETURN_DISTANCE2_DIV = 6

The distance to the nearest point is divided by the distance to the second-nearest point.

enum DomainWarpType
DOMAIN_WARP_SIMPLEX = 0

The domain is warped using the simplex noise algorithm.

DOMAIN_WARP_SIMPLEX_REDUCED = 1

The domain is warped using a simplified version of the simplex noise algorithm.

DOMAIN_WARP_BASIC_GRID = 2

The domain is warped using a simple noise grid (not as smooth as the other methods, but more performant).

enum DomainWarpFractalType
DOMAIN_WARP_FRACTAL_NONE = 0

No fractal noise for warping the space.

DOMAIN_WARP_FRACTAL_PROGRESSIVE = 1

Warping the space progressively, octave for octave, resulting in a more "liquified" distortion.

DOMAIN_WARP_FRACTAL_INDEPENDENT = 2

Warping the space independently for each octave, resulting in a more chaotic distortion.