2
0

class_noisetexture.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/noise/doc_classes/NoiseTexture.xml.
  6. .. _class_NoiseTexture:
  7. NoiseTexture
  8. ============
  9. **Inherits:** :ref:`Texture2D<class_Texture2D>` **<** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A texture filled with noise generated by a :ref:`Noise<class_Noise>` object.
  11. Description
  12. -----------
  13. Uses :ref:`FastNoiseLite<class_FastNoiseLite>` or other libraries to fill the texture data of your desired size.
  14. NoiseTexture can also generate normalmap textures.
  15. The class uses :ref:`Thread<class_Thread>`\ s to generate the texture data internally, so :ref:`Texture2D.get_image<class_Texture2D_method_get_image>` may return ``null`` if the generation process has not completed yet. In that case, you need to wait for the texture to be generated before accessing the image and the generated byte data:
  16. ::
  17. var texture = NoiseTexture.new()
  18. texture.noise = FastNoiseLite.new()
  19. await texture.changed
  20. var image = texture.get_image()
  21. var data = image.get_data()
  22. Properties
  23. ----------
  24. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  25. | :ref:`bool<class_bool>` | :ref:`as_normal_map<class_NoiseTexture_property_as_normal_map>` | ``false`` |
  26. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  27. | :ref:`float<class_float>` | :ref:`bump_strength<class_NoiseTexture_property_bump_strength>` | ``8.0`` |
  28. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  29. | :ref:`Gradient<class_Gradient>` | :ref:`color_ramp<class_NoiseTexture_property_color_ramp>` | |
  30. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`generate_mipmaps<class_NoiseTexture_property_generate_mipmaps>` | ``true`` |
  32. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  33. | :ref:`int<class_int>` | :ref:`height<class_NoiseTexture_property_height>` | ``512`` |
  34. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`in_3d_space<class_NoiseTexture_property_in_3d_space>` | ``false`` |
  36. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  37. | :ref:`bool<class_bool>` | :ref:`invert<class_NoiseTexture_property_invert>` | ``false`` |
  38. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  39. | :ref:`Noise<class_Noise>` | :ref:`noise<class_NoiseTexture_property_noise>` | |
  40. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  41. | :ref:`bool<class_bool>` | :ref:`seamless<class_NoiseTexture_property_seamless>` | ``false`` |
  42. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  43. | :ref:`float<class_float>` | :ref:`seamless_blend_skirt<class_NoiseTexture_property_seamless_blend_skirt>` | ``0.1`` |
  44. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  45. | :ref:`int<class_int>` | :ref:`width<class_NoiseTexture_property_width>` | ``512`` |
  46. +---------------------------------+-------------------------------------------------------------------------------+-----------+
  47. Property Descriptions
  48. ---------------------
  49. .. _class_NoiseTexture_property_as_normal_map:
  50. - :ref:`bool<class_bool>` **as_normal_map**
  51. +-----------+--------------------------+
  52. | *Default* | ``false`` |
  53. +-----------+--------------------------+
  54. | *Setter* | set_as_normal_map(value) |
  55. +-----------+--------------------------+
  56. | *Getter* | is_normal_map() |
  57. +-----------+--------------------------+
  58. If ``true``, the resulting texture contains a normal map created from the original noise interpreted as a bump map.
  59. ----
  60. .. _class_NoiseTexture_property_bump_strength:
  61. - :ref:`float<class_float>` **bump_strength**
  62. +-----------+--------------------------+
  63. | *Default* | ``8.0`` |
  64. +-----------+--------------------------+
  65. | *Setter* | set_bump_strength(value) |
  66. +-----------+--------------------------+
  67. | *Getter* | get_bump_strength() |
  68. +-----------+--------------------------+
  69. Strength of the bump maps used in this texture. A higher value will make the bump maps appear larger while a lower value will make them appear softer.
  70. ----
  71. .. _class_NoiseTexture_property_color_ramp:
  72. - :ref:`Gradient<class_Gradient>` **color_ramp**
  73. +----------+-----------------------+
  74. | *Setter* | set_color_ramp(value) |
  75. +----------+-----------------------+
  76. | *Getter* | get_color_ramp() |
  77. +----------+-----------------------+
  78. A :ref:`Gradient<class_Gradient>` which is used to map the luminance of each pixel to a color value.
  79. ----
  80. .. _class_NoiseTexture_property_generate_mipmaps:
  81. - :ref:`bool<class_bool>` **generate_mipmaps**
  82. +-----------+-----------------------------+
  83. | *Default* | ``true`` |
  84. +-----------+-----------------------------+
  85. | *Setter* | set_generate_mipmaps(value) |
  86. +-----------+-----------------------------+
  87. | *Getter* | is_generating_mipmaps() |
  88. +-----------+-----------------------------+
  89. Determines whether mipmaps are generated for this texture.
  90. Enabling this results in less texture aliasing, but the noise texture generation may take longer.
  91. Requires (anisotropic) mipmap filtering to be enabled for a material to have an effect.
  92. ----
  93. .. _class_NoiseTexture_property_height:
  94. - :ref:`int<class_int>` **height**
  95. +-----------+-------------------+
  96. | *Default* | ``512`` |
  97. +-----------+-------------------+
  98. | *Setter* | set_height(value) |
  99. +-----------+-------------------+
  100. | *Getter* | get_height() |
  101. +-----------+-------------------+
  102. Height of the generated texture.
  103. ----
  104. .. _class_NoiseTexture_property_in_3d_space:
  105. - :ref:`bool<class_bool>` **in_3d_space**
  106. +-----------+------------------------+
  107. | *Default* | ``false`` |
  108. +-----------+------------------------+
  109. | *Setter* | set_in_3d_space(value) |
  110. +-----------+------------------------+
  111. | *Getter* | is_in_3d_space() |
  112. +-----------+------------------------+
  113. Determines whether the noise image is calculated in 3D space. May result in reduced contrast.
  114. ----
  115. .. _class_NoiseTexture_property_invert:
  116. - :ref:`bool<class_bool>` **invert**
  117. +-----------+-------------------+
  118. | *Default* | ``false`` |
  119. +-----------+-------------------+
  120. | *Setter* | set_invert(value) |
  121. +-----------+-------------------+
  122. | *Getter* | get_invert() |
  123. +-----------+-------------------+
  124. If ``true``, inverts the noise texture. White becomes black, black becomes white.
  125. ----
  126. .. _class_NoiseTexture_property_noise:
  127. - :ref:`Noise<class_Noise>` **noise**
  128. +----------+------------------+
  129. | *Setter* | set_noise(value) |
  130. +----------+------------------+
  131. | *Getter* | get_noise() |
  132. +----------+------------------+
  133. The instance of the :ref:`Noise<class_Noise>` object.
  134. ----
  135. .. _class_NoiseTexture_property_seamless:
  136. - :ref:`bool<class_bool>` **seamless**
  137. +-----------+---------------------+
  138. | *Default* | ``false`` |
  139. +-----------+---------------------+
  140. | *Setter* | set_seamless(value) |
  141. +-----------+---------------------+
  142. | *Getter* | get_seamless() |
  143. +-----------+---------------------+
  144. If ``true``, a seamless texture is requested from the :ref:`Noise<class_Noise>` resource.
  145. \ **Note:** Seamless noise textures may take longer to generate and/or can have a lower contrast compared to non-seamless noise depending on the used :ref:`Noise<class_Noise>` resource. This is because some implementations use higher dimensions for generating seamless noise.
  146. ----
  147. .. _class_NoiseTexture_property_seamless_blend_skirt:
  148. - :ref:`float<class_float>` **seamless_blend_skirt**
  149. +-----------+---------------------------------+
  150. | *Default* | ``0.1`` |
  151. +-----------+---------------------------------+
  152. | *Setter* | set_seamless_blend_skirt(value) |
  153. +-----------+---------------------------------+
  154. | *Getter* | get_seamless_blend_skirt() |
  155. +-----------+---------------------------------+
  156. Used for the default/fallback implementation of the seamless texture generation. It determines the distance over which the seams are blended. High values may result in less details and contrast. See :ref:`Noise<class_Noise>` for further details.
  157. ----
  158. .. _class_NoiseTexture_property_width:
  159. - :ref:`int<class_int>` **width**
  160. +-----------+------------------+
  161. | *Default* | ``512`` |
  162. +-----------+------------------+
  163. | *Setter* | set_width(value) |
  164. +-----------+------------------+
  165. | *Getter* | get_width() |
  166. +-----------+------------------+
  167. Width of the generated texture.
  168. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  169. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  170. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  171. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  172. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  173. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`