Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Noise¶
继承: Resource < RefCounted < Object
派生: FastNoiseLite
噪声生成器的抽象基类。
描述¶
该类定义了噪声生成库要继承的接口。
为不提供无缝噪声的库提供一个默认的 get_seamless_image 实现。该函数从 get_image 请求更大的图像,反转该图像的象限,然后使用额外宽度的条带在接缝处混合。
继承的噪声类可以选择性地覆盖该函数,以提供更优化的算法。
方法¶
get_image ( int width, int height, bool invert=false, bool in_3d_space=false, bool normalize=true ) const |
|
get_image_3d ( int width, int height, int depth, bool invert=false, bool normalize=true ) const |
|
get_noise_1d ( float x ) const |
|
get_noise_2d ( float x, float y ) const |
|
get_noise_2dv ( Vector2 v ) const |
|
get_noise_3d ( float x, float y, float z ) const |
|
get_noise_3dv ( Vector3 v ) const |
|
get_seamless_image ( int width, int height, bool invert=false, bool in_3d_space=false, float skirt=0.1, bool normalize=true ) const |
|
get_seamless_image_3d ( int width, int height, int depth, bool invert=false, float skirt=0.1, bool normalize=true ) const |
方法说明¶
Image get_image ( int width, int height, bool invert=false, bool in_3d_space=false, bool normalize=true ) const
返回包含 2D 噪声值的 Image。
注意:normalize
为 false
时,默认实现要求噪声生成器返回 -1.0
到 1.0
之间的值。
Image[] get_image_3d ( int width, int height, int depth, bool invert=false, bool normalize=true ) const
返回包含 3D 噪声值的 Image 的 Array,用于 ImageTexture3D.create。
注意:normalize
为 false
时,默认实现要求噪声生成器返回 -1.0
到 1.0
之间的值。
float get_noise_1d ( float x ) const
返回给定 (x) 坐标处的 1D 噪声值。
float get_noise_2d ( float x, float y ) const
返回给定位置处的 2D 噪声值。
float get_noise_2dv ( Vector2 v ) const
返回给定位置处的 2D 噪声值。
float get_noise_3d ( float x, float y, float z ) const
返回给定位置处的 3D 噪声值。
float get_noise_3dv ( Vector3 v ) const
返回给定位置处的 3D 噪声值。
Image get_seamless_image ( int width, int height, bool invert=false, bool in_3d_space=false, float skirt=0.1, bool normalize=true ) const
返回包含无缝 2D 噪声值的 Image。
注意:normalize
为 false
时,默认实现要求噪声生成器返回 -1.0
到 1.0
之间的值。
Image[] get_seamless_image_3d ( int width, int height, int depth, bool invert=false, float skirt=0.1, bool normalize=true ) const
返回包含无缝 3D 噪声值的 Image 的 Array,用于 ImageTexture3D.create。
注意:normalize
为 false
时,默认实现要求噪声生成器返回 -1.0
到 1.0
之间的值。