class_noise.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/modules/noise/doc_classes/Noise.xml.
  6. .. _class_Noise:
  7. Noise
  8. =====
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`FastNoiseLite<class_FastNoiseLite>`
  11. Abstract base class for noise generators.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. This class defines the interface for noise generation libraries to inherit from.
  16. A default :ref:`get_seamless_image<class_Noise_method_get_seamless_image>` implementation is provided for libraries that do not provide seamless noise. This function requests a larger image from the :ref:`get_image<class_Noise_method_get_image>` method, reverses the quadrants of the image, then uses the strips of extra width to blend over the seams.
  17. Inheriting noise classes can optionally override this function to provide a more optimal algorithm.
  18. .. rst-class:: classref-reftable-group
  19. Methods
  20. -------
  21. .. table::
  22. :widths: auto
  23. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Image<class_Image>` | :ref:`get_image<class_Noise_method_get_image>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` in_3d_space=false, :ref:`bool<class_bool>` normalize=true **)** |const| |
  25. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Image[]<class_Image>` | :ref:`get_image_3d<class_Noise_method_get_image_3d>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` depth, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` normalize=true **)** |const| |
  27. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_noise_1d<class_Noise_method_get_noise_1d>` **(** :ref:`float<class_float>` x **)** |const| |
  29. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`get_noise_2d<class_Noise_method_get_noise_2d>` **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y **)** |const| |
  31. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`get_noise_2dv<class_Noise_method_get_noise_2dv>` **(** :ref:`Vector2<class_Vector2>` v **)** |const| |
  33. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`get_noise_3d<class_Noise_method_get_noise_3d>` **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y, :ref:`float<class_float>` z **)** |const| |
  35. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`get_noise_3dv<class_Noise_method_get_noise_3dv>` **(** :ref:`Vector3<class_Vector3>` v **)** |const| |
  37. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Image<class_Image>` | :ref:`get_seamless_image<class_Noise_method_get_seamless_image>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` in_3d_space=false, :ref:`float<class_float>` skirt=0.1, :ref:`bool<class_bool>` normalize=true **)** |const| |
  39. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Image[]<class_Image>` | :ref:`get_seamless_image_3d<class_Noise_method_get_seamless_image_3d>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` depth, :ref:`bool<class_bool>` invert=false, :ref:`float<class_float>` skirt=0.1, :ref:`bool<class_bool>` normalize=true **)** |const| |
  41. +-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. .. rst-class:: classref-section-separator
  43. ----
  44. .. rst-class:: classref-descriptions-group
  45. Method Descriptions
  46. -------------------
  47. .. _class_Noise_method_get_image:
  48. .. rst-class:: classref-method
  49. :ref:`Image<class_Image>` **get_image** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` in_3d_space=false, :ref:`bool<class_bool>` normalize=true **)** |const|
  50. Returns an :ref:`Image<class_Image>` containing 2D noise values.
  51. \ **Note:** With ``normalize`` set to ``false``, the default implementation expects the noise generator to return values in the range ``-1.0`` to ``1.0``.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_Noise_method_get_image_3d:
  55. .. rst-class:: classref-method
  56. :ref:`Image[]<class_Image>` **get_image_3d** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` depth, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` normalize=true **)** |const|
  57. Returns an :ref:`Array<class_Array>` of :ref:`Image<class_Image>`\ s containing 3D noise values for use with :ref:`ImageTexture3D.create<class_ImageTexture3D_method_create>`.
  58. \ **Note:** With ``normalize`` set to ``false``, the default implementation expects the noise generator to return values in the range ``-1.0`` to ``1.0``.
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_Noise_method_get_noise_1d:
  62. .. rst-class:: classref-method
  63. :ref:`float<class_float>` **get_noise_1d** **(** :ref:`float<class_float>` x **)** |const|
  64. Returns the 1D noise value at the given (x) coordinate.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_Noise_method_get_noise_2d:
  68. .. rst-class:: classref-method
  69. :ref:`float<class_float>` **get_noise_2d** **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y **)** |const|
  70. Returns the 2D noise value at the given position.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_Noise_method_get_noise_2dv:
  74. .. rst-class:: classref-method
  75. :ref:`float<class_float>` **get_noise_2dv** **(** :ref:`Vector2<class_Vector2>` v **)** |const|
  76. Returns the 2D noise value at the given position.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_Noise_method_get_noise_3d:
  80. .. rst-class:: classref-method
  81. :ref:`float<class_float>` **get_noise_3d** **(** :ref:`float<class_float>` x, :ref:`float<class_float>` y, :ref:`float<class_float>` z **)** |const|
  82. Returns the 3D noise value at the given position.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_Noise_method_get_noise_3dv:
  86. .. rst-class:: classref-method
  87. :ref:`float<class_float>` **get_noise_3dv** **(** :ref:`Vector3<class_Vector3>` v **)** |const|
  88. Returns the 3D noise value at the given position.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_Noise_method_get_seamless_image:
  92. .. rst-class:: classref-method
  93. :ref:`Image<class_Image>` **get_seamless_image** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`bool<class_bool>` invert=false, :ref:`bool<class_bool>` in_3d_space=false, :ref:`float<class_float>` skirt=0.1, :ref:`bool<class_bool>` normalize=true **)** |const|
  94. Returns an :ref:`Image<class_Image>` containing seamless 2D noise values.
  95. \ **Note:** With ``normalize`` set to ``false``, the default implementation expects the noise generator to return values in the range ``-1.0`` to ``1.0``.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_Noise_method_get_seamless_image_3d:
  99. .. rst-class:: classref-method
  100. :ref:`Image[]<class_Image>` **get_seamless_image_3d** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` depth, :ref:`bool<class_bool>` invert=false, :ref:`float<class_float>` skirt=0.1, :ref:`bool<class_bool>` normalize=true **)** |const|
  101. Returns an :ref:`Array<class_Array>` of :ref:`Image<class_Image>`\ s containing seamless 3D noise values for use with :ref:`ImageTexture3D.create<class_ImageTexture3D_method_create>`.
  102. \ **Note:** With ``normalize`` set to ``false``, the default implementation expects the noise generator to return values in the range ``-1.0`` to ``1.0``.
  103. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  104. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  105. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  106. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  107. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  108. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  109. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`