189 lines
8.3 KiB
ReStructuredText
189 lines
8.3 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/3.6/modules/opensimplex/doc_classes/NoiseTexture.xml.
|
|
|
|
.. _class_NoiseTexture:
|
|
|
|
NoiseTexture
|
|
============
|
|
|
|
**Inherits:** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
|
|
|
|
:ref:`OpenSimplexNoise<class_OpenSimplexNoise>` filled texture.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Description
|
|
-----------
|
|
|
|
Uses an :ref:`OpenSimplexNoise<class_OpenSimplexNoise>` to fill the texture data. You can specify the texture size but keep in mind that larger textures will take longer to generate and seamless noise only works with square sized textures.
|
|
|
|
NoiseTexture can also generate normalmap textures.
|
|
|
|
The class uses :ref:`Thread<class_Thread>`\ s to generate the texture data internally, so :ref:`Texture.get_data<class_Texture_method_get_data>` 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 data:
|
|
|
|
::
|
|
|
|
var texture = preload("res://noise.tres")
|
|
yield(texture, "changed")
|
|
var image = texture.get_data()
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Properties
|
|
----------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`as_normalmap<class_NoiseTexture_property_as_normalmap>` | ``false`` |
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`bump_strength<class_NoiseTexture_property_bump_strength>` | ``8.0`` |
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | flags | ``7`` (overrides :ref:`Texture<class_Texture_property_flags>`) |
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`height<class_NoiseTexture_property_height>` | ``512`` |
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
| :ref:`OpenSimplexNoise<class_OpenSimplexNoise>` | :ref:`noise<class_NoiseTexture_property_noise>` | |
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`noise_offset<class_NoiseTexture_property_noise_offset>` | ``Vector2( 0, 0 )`` |
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`seamless<class_NoiseTexture_property_seamless>` | ``false`` |
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`width<class_NoiseTexture_property_width>` | ``512`` |
|
|
+-------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_NoiseTexture_property_as_normalmap:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **as_normalmap** = ``false``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_as_normalmap** **(** :ref:`bool<class_bool>` value **)**
|
|
- :ref:`bool<class_bool>` **is_normalmap** **(** **)**
|
|
|
|
If ``true``, the resulting texture contains a normal map created from the original noise interpreted as a bump map.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_NoiseTexture_property_bump_strength:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **bump_strength** = ``8.0``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_bump_strength** **(** :ref:`float<class_float>` value **)**
|
|
- :ref:`float<class_float>` **get_bump_strength** **(** **)**
|
|
|
|
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.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_NoiseTexture_property_height:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **height** = ``512``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_height** **(** :ref:`int<class_int>` value **)**
|
|
- :ref:`int<class_int>` **get_height** **(** **)**
|
|
|
|
Height of the generated texture.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_NoiseTexture_property_noise:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`OpenSimplexNoise<class_OpenSimplexNoise>` **noise**
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_noise** **(** :ref:`OpenSimplexNoise<class_OpenSimplexNoise>` value **)**
|
|
- :ref:`OpenSimplexNoise<class_OpenSimplexNoise>` **get_noise** **(** **)**
|
|
|
|
The :ref:`OpenSimplexNoise<class_OpenSimplexNoise>` instance used to generate the noise.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_NoiseTexture_property_noise_offset:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **noise_offset** = ``Vector2( 0, 0 )``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_noise_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
|
|
- :ref:`Vector2<class_Vector2>` **get_noise_offset** **(** **)**
|
|
|
|
An offset used to specify the noise space coordinate of the top left corner of the generated noise. This value is ignored if :ref:`seamless<class_NoiseTexture_property_seamless>` is enabled.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_NoiseTexture_property_seamless:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **seamless** = ``false``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_seamless** **(** :ref:`bool<class_bool>` value **)**
|
|
- :ref:`bool<class_bool>` **get_seamless** **(** **)**
|
|
|
|
Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate.
|
|
|
|
\ **Note:** Seamless noise has a lower contrast compared to non-seamless noise. This is due to the way noise uses higher dimensions for generating seamless noise.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_NoiseTexture_property_width:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **width** = ``512``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_width** **(** :ref:`int<class_int>` value **)**
|
|
- :ref:`int<class_int>` **get_width** **(** **)**
|
|
|
|
Width of the generated texture.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|