Noise
继承: Resource
< RefCounted
< Object
派生: FastNoiseLite
Abstract base class for noise generators.
描述
This class defines the interface for noise generation libraries to inherit from.
A default get_seamless_image
implementation is provided for libraries that do not provide seamless noise. This function requests a larger image from the get_image
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.
方法
Image | get_image ( width: int , height: int , invert: bool = false, in_3d_space: bool = false, normalize: bool = true ) const1 |
Array Image | get_image_3d ( width: int , height: int , depth: int , invert: bool = false, normalize: bool = true ) const1 |
float | get_noise_1d ( x: float ) const1 |
float | get_noise_2d ( x: float , y: float ) const1 |
float | get_noise_2dv ( v: Vector2 ) const1 |
float | get_noise_3d ( x: float , y: float , z: float ) const1 |
float | get_noise_3dv ( v: Vector3 ) const1 |
Image | get_seamless_image ( width: int , height: int , invert: bool = false, in_3d_space: bool = false, skirt: float = 0.1, normalize: bool = true ) const1 |
Array Image | get_seamless_image_3d ( width: int , height: int , depth: int , invert: bool = false, skirt: float = 0.1, normalize: bool = true ) const1 |
方法说明
Image
get_image ( width: int
, height: int
, invert: bool
= false, in_3d_space: bool
= false, normalize: bool
= true ) const1
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
.
Array Image
get_image_3d ( width: int
, height: int
, depth: int
, invert: bool
= false, normalize: bool
= true ) const1
Returns an Array
of Image
s containing 3D noise values for use with ImageTexture3D.create
.
Note: With normalize
set to false
, the default implementation expects the noise generator to return values in the range -1.0
to 1.0
.
float
get_noise_1d ( x: float
) const1
Returns the 1D noise value at the given (x) coordinate.
float
get_noise_2d ( x: float
, y: float
) const1
Returns the 2D noise value at the given position.
float
get_noise_2dv ( v: Vector2
) const1
Returns the 2D noise value at the given position.
float
get_noise_3d ( x: float
, y: float
, z: float
) const1
Returns the 3D noise value at the given position.
float
get_noise_3dv ( v: Vector3
) const1
Returns the 3D noise value at the given position.
Image
get_seamless_image ( width: int
, height: int
, invert: bool
= false, in_3d_space: bool
= false, skirt: float
= 0.1, normalize: bool
= true ) const1
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
.
Array Image
get_seamless_image_3d ( width: int
, height: int
, depth: int
, invert: bool
= false, skirt: float
= 0.1, normalize: bool
= true ) const1
Returns an Array
of Image
s containing seamless 3D noise values for use with ImageTexture3D.create
.
Note: With normalize
set to false
, the default implementation expects the noise generator to return values in the range -1.0
to 1.0
.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。