Table of Contents

Class Noise

Namespace
Godot
Assembly
GodotSharp.dll

This class defines the interface for noise generation libraries to inherit from.

A default GetSeamlessImage(int, int, bool, bool, float, bool) implementation is provided for libraries that do not provide seamless noise. This function requests a larger image from the GetImage(int, int, bool, bool, bool) method, reverses the quadrants of the image, then uses the strips of extra width to blend over the seams.

Inheriting noise classes can optionally override this function to provide a more optimal algorithm.

public class Noise : Resource, IDisposable
Inheritance
Noise
Implements
Derived
Inherited Members

Methods

GetImage(int, int, bool, bool, bool)

Returns an Image containing 2D noise values.

Note: With normalize set to false, the default implementation expects the noise generator to return values in the range -1.0 to 1.0.

public Image GetImage(int width, int height, bool invert = false, bool in3DSpace = false, bool normalize = true)

Parameters

width int
height int
invert bool
in3DSpace bool
normalize bool

Returns

Image

GetImage3D(int, int, int, bool, bool)

Returns an Array of Images containing 3D noise values for use with Create(Format, int, int, int, bool, Array<Image>).

Note: With normalize set to false, the default implementation expects the noise generator to return values in the range -1.0 to 1.0.

public Array<Image> GetImage3D(int width, int height, int depth, bool invert = false, bool normalize = true)

Parameters

width int
height int
depth int
invert bool
normalize bool

Returns

Array<Image>

GetNoise1D(float)

Returns the 1D noise value at the given (x) coordinate.

public float GetNoise1D(float x)

Parameters

x float

Returns

float

GetNoise2D(float, float)

Returns the 2D noise value at the given position.

public float GetNoise2D(float x, float y)

Parameters

x float
y float

Returns

float

GetNoise2Dv(Vector2)

Returns the 2D noise value at the given position.

public float GetNoise2Dv(Vector2 v)

Parameters

v Vector2

Returns

float

GetNoise3D(float, float, float)

Returns the 3D noise value at the given position.

public float GetNoise3D(float x, float y, float z)

Parameters

x float
y float
z float

Returns

float

GetNoise3Dv(Vector3)

Returns the 3D noise value at the given position.

public float GetNoise3Dv(Vector3 v)

Parameters

v Vector3

Returns

float

GetSeamlessImage(int, int, bool, bool, float, bool)

Returns an Image containing seamless 2D noise values.

Note: With normalize set to false, the default implementation expects the noise generator to return values in the range -1.0 to 1.0.

public Image GetSeamlessImage(int width, int height, bool invert = false, bool in3DSpace = false, float skirt = 0.1, bool normalize = true)

Parameters

width int
height int
invert bool
in3DSpace bool
skirt float
normalize bool

Returns

Image

GetSeamlessImage3D(int, int, int, bool, float, bool)

Returns an Array of Images containing seamless 3D noise values for use with Create(Format, int, int, int, bool, Array<Image>).

Note: With normalize set to false, the default implementation expects the noise generator to return values in the range -1.0 to 1.0.

public Array<Image> GetSeamlessImage3D(int width, int height, int depth, bool invert = false, float skirt = 0.1, bool normalize = true)

Parameters

width int
height int
depth int
invert bool
skirt float
normalize bool

Returns

Array<Image>

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool