OpenSimplexNoise

Noise generator based on Open Simplex.

This resource allows you to configure and sample a fractal noise space. Here is a brief usage example that configures an OpenSimplexNoise and gets samples at various positions and dimensions:

More...

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

getImage
Ref!Image getImage(long width, long height)

Generate a noise image in constant Image.FORMAT_L8 format with the requested width and height, based on the current noise parameters.

getLacunarity
double getLacunarity()
getNoise1d
double getNoise1d(double x)

Returns the 1D noise value $(D -1,1) at the given x-coordinate. Note: This method actually returns the 2D noise value $(D -1,1) with fixed y-coordinate value 0.0.

getNoise2d
double getNoise2d(double x, double y)

Returns the 2D noise value $(D -1,1) at the given position.

getNoise2dv
double getNoise2dv(Vector2 pos)

Returns the 2D noise value $(D -1,1) at the given position.

getNoise3d
double getNoise3d(double x, double y, double z)

Returns the 3D noise value $(D -1,1) at the given position.

getNoise3dv
double getNoise3dv(Vector3 pos)

Returns the 3D noise value $(D -1,1) at the given position.

getNoise4d
double getNoise4d(double x, double y, double z, double w)

Returns the 4D noise value $(D -1,1) at the given position.

getOctaves
long getOctaves()
getPeriod
double getPeriod()
getPersistence
double getPersistence()
getSeamlessImage
Ref!Image getSeamlessImage(long size)

Generate a tileable noise image in constant Image.FORMAT_L8 format, based on the current noise parameters. Generated seamless images are always square (size × size). Note: Seamless noise has a lower contrast compared to non-seamless noise. This is due to the way noise uses higher dimensions for generating seamless noise.

getSeed
long getSeed()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(OpenSimplexNoise other)
opEquals
bool opEquals(typeof(null) n)
setLacunarity
void setLacunarity(double lacunarity)
setOctaves
void setOctaves(long octave_count)
setPeriod
void setPeriod(double period)
setPersistence
void setPersistence(double persistence)
setSeed
void setSeed(long seed)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

lacunarity
double lacunarity [@property getter]
double lacunarity [@property setter]

Difference in period between octaves.

octaves
long octaves [@property getter]
long octaves [@property setter]

Number of OpenSimplex noise layers that are sampled to get the fractal noise. Higher values result in more detailed noise but take more time to generate. Note: The maximum allowed value is 9.

period
double period [@property getter]
double period [@property setter]

Period of the base octave. A lower period results in a higher-frequency noise (more value changes across the same distance).

persistence
double persistence [@property getter]
double persistence [@property setter]

Contribution factor of the different octaves. A persistence value of 1 means all the octaves have the same contribution, a value of 0.5 means each octave contributes half as much as the previous one.

seed
long seed [@property getter]
long seed [@property setter]

Seed used to generate random values, different seeds will generate different noise maps.

Static functions

_new
OpenSimplexNoise _new()

Construct a new instance of OpenSimplexNoise. Note: use memnew!OpenSimplexNoise instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Detailed Description

var noise = OpenSimplexNoise.new()

# Configure noise.seed = randi() noise.octaves = 4 noise.period = 20.0 noise.persistence = 0.8

# Sample print("Values:") print(noise.get_noise_2d(1.0, 1.0)) print(noise.get_noise_3d(0.5, 3.0, 15.0)) print(noise.get_noise_4d(0.5, 1.9, 4.7, 0.0))

Meta