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
Returns
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
Returns
GetNoise1D(float)
Returns the 1D noise value at the given (x) coordinate.
public float GetNoise1D(float x)
Parameters
x
float
Returns
GetNoise2D(float, float)
Returns the 2D noise value at the given position.
public float GetNoise2D(float x, float y)
Parameters
Returns
GetNoise2Dv(Vector2)
Returns the 2D noise value at the given position.
public float GetNoise2Dv(Vector2 v)
Parameters
v
Vector2
Returns
GetNoise3D(float, float, float)
Returns the 3D noise value at the given position.
public float GetNoise3D(float x, float y, float z)
Parameters
Returns
GetNoise3Dv(Vector3)
Returns the 3D noise value at the given position.
public float GetNoise3Dv(Vector3 v)
Parameters
v
Vector3
Returns
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
Returns
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
Returns
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_nameName of the method to check for.
Returns
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_nameName of the signal to check for.
Returns
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_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.