Path: blob/master/modules/noise/doc_classes/NoiseTexture2D.xml
10278 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="NoiseTexture2D" inherits="Texture2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3A 2D texture filled with noise generated by a [Noise] object.4</brief_description>5<description>6Uses the [FastNoiseLite] library or other noise generators to fill the texture data of your desired size. [NoiseTexture2D] can also generate normal map textures.7The class uses [Thread]s to generate the texture data internally, so [method Texture2D.get_image] may return [code]null[/code] 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:8[codeblock]9var texture = NoiseTexture2D.new()10texture.noise = FastNoiseLite.new()11await texture.changed12var image = texture.get_image()13var data = image.get_data()14[/codeblock]15</description>16<tutorials>17</tutorials>18<members>19<member name="as_normal_map" type="bool" setter="set_as_normal_map" getter="is_normal_map" default="false">20If [code]true[/code], the resulting texture contains a normal map created from the original noise interpreted as a bump map.21</member>22<member name="bump_strength" type="float" setter="set_bump_strength" getter="get_bump_strength" default="8.0">23Strength 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.24</member>25<member name="color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp">26A [Gradient] which is used to map the luminance of each pixel to a color value.27</member>28<member name="generate_mipmaps" type="bool" setter="set_generate_mipmaps" getter="is_generating_mipmaps" default="true">29Determines whether mipmaps are generated for this texture. Enabling this results in less texture aliasing in the distance, at the cost of increasing memory usage by roughly 33% and making the noise texture generation take longer.30[b]Note:[/b] [member generate_mipmaps] requires mipmap filtering to be enabled on the material using the [NoiseTexture2D] to have an effect.31</member>32<member name="height" type="int" setter="set_height" getter="get_height" default="512">33Height of the generated texture (in pixels).34</member>35<member name="in_3d_space" type="bool" setter="set_in_3d_space" getter="is_in_3d_space" default="false">36Determines whether the noise image is calculated in 3D space. May result in reduced contrast.37</member>38<member name="invert" type="bool" setter="set_invert" getter="get_invert" default="false">39If [code]true[/code], inverts the noise texture. White becomes black, black becomes white.40</member>41<member name="noise" type="Noise" setter="set_noise" getter="get_noise">42The instance of the [Noise] object.43</member>44<member name="normalize" type="bool" setter="set_normalize" getter="is_normalized" default="true">45If [code]true[/code], the noise image coming from the noise generator is normalized to the range [code]0.0[/code] to [code]1.0[/code].46Turning normalization off can affect the contrast and allows you to generate non repeating tileable noise textures.47</member>48<member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />49<member name="seamless" type="bool" setter="set_seamless" getter="get_seamless" default="false">50If [code]true[/code], a seamless texture is requested from the [Noise] resource.51[b]Note:[/b] Seamless noise textures may take longer to generate and/or can have a lower contrast compared to non-seamless noise depending on the used [Noise] resource. This is because some implementations use higher dimensions for generating seamless noise.52[b]Note:[/b] The default [FastNoiseLite] implementation uses the fallback path for seamless generation. If using a [member width] or [member height] lower than the default, you may need to increase [member seamless_blend_skirt] to make seamless blending more effective.53</member>54<member name="seamless_blend_skirt" type="float" setter="set_seamless_blend_skirt" getter="get_seamless_blend_skirt" default="0.1">55Used 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 [Noise] for further details.56[b]Note:[/b] If using a [member width] or [member height] lower than the default, you may need to increase [member seamless_blend_skirt] to make seamless blending more effective.57</member>58<member name="width" type="int" setter="set_width" getter="get_width" default="512">59Width of the generated texture (in pixels).60</member>61</members>62</class>636465