class_visualshadernodetextureparameter.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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/doc/classes/VisualShaderNodeTextureParameter.xml.
  6. .. _class_VisualShaderNodeTextureParameter:
  7. VisualShaderNodeTextureParameter
  8. ================================
  9. **Inherits:** :ref:`VisualShaderNodeParameter<class_VisualShaderNodeParameter>` **<** :ref:`VisualShaderNode<class_VisualShaderNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`VisualShaderNodeCubemapParameter<class_VisualShaderNodeCubemapParameter>`, :ref:`VisualShaderNodeTexture2DArrayParameter<class_VisualShaderNodeTexture2DArrayParameter>`, :ref:`VisualShaderNodeTexture2DParameter<class_VisualShaderNodeTexture2DParameter>`, :ref:`VisualShaderNodeTexture3DParameter<class_VisualShaderNodeTexture3DParameter>`, :ref:`VisualShaderNodeTextureParameterTriplanar<class_VisualShaderNodeTextureParameterTriplanar>`
  11. Performs a uniform texture lookup within the visual shader graph.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Performs a lookup operation on the texture provided as a uniform for the shader.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
  22. | :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` | :ref:`color_default<class_VisualShaderNodeTextureParameter_property_color_default>` | ``0`` |
  23. +---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
  24. | :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` | :ref:`texture_filter<class_VisualShaderNodeTextureParameter_property_texture_filter>` | ``0`` |
  25. +---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
  26. | :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` | :ref:`texture_repeat<class_VisualShaderNodeTextureParameter_property_texture_repeat>` | ``0`` |
  27. +---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
  28. | :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` | :ref:`texture_source<class_VisualShaderNodeTextureParameter_property_texture_source>` | ``0`` |
  29. +---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
  30. | :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` | :ref:`texture_type<class_VisualShaderNodeTextureParameter_property_texture_type>` | ``0`` |
  31. +---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
  32. .. rst-class:: classref-section-separator
  33. ----
  34. .. rst-class:: classref-descriptions-group
  35. Enumerations
  36. ------------
  37. .. _enum_VisualShaderNodeTextureParameter_TextureType:
  38. .. rst-class:: classref-enumeration
  39. enum **TextureType**:
  40. .. _class_VisualShaderNodeTextureParameter_constant_TYPE_DATA:
  41. .. rst-class:: classref-enumeration-constant
  42. :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_DATA** = ``0``
  43. No hints are added to the uniform declaration.
  44. .. _class_VisualShaderNodeTextureParameter_constant_TYPE_COLOR:
  45. .. rst-class:: classref-enumeration-constant
  46. :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_COLOR** = ``1``
  47. Adds ``source_color`` as hint to the uniform declaration for proper sRGB to linear conversion.
  48. .. _class_VisualShaderNodeTextureParameter_constant_TYPE_NORMAL_MAP:
  49. .. rst-class:: classref-enumeration-constant
  50. :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_NORMAL_MAP** = ``2``
  51. Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
  52. .. _class_VisualShaderNodeTextureParameter_constant_TYPE_ANISOTROPY:
  53. .. rst-class:: classref-enumeration-constant
  54. :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_ANISOTROPY** = ``3``
  55. Adds ``hint_anisotropy`` as hint to the uniform declaration to use for a flowmap.
  56. .. _class_VisualShaderNodeTextureParameter_constant_TYPE_MAX:
  57. .. rst-class:: classref-enumeration-constant
  58. :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_MAX** = ``4``
  59. Represents the size of the :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` enum.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _enum_VisualShaderNodeTextureParameter_ColorDefault:
  63. .. rst-class:: classref-enumeration
  64. enum **ColorDefault**:
  65. .. _class_VisualShaderNodeTextureParameter_constant_COLOR_DEFAULT_WHITE:
  66. .. rst-class:: classref-enumeration-constant
  67. :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **COLOR_DEFAULT_WHITE** = ``0``
  68. Defaults to fully opaque white color.
  69. .. _class_VisualShaderNodeTextureParameter_constant_COLOR_DEFAULT_BLACK:
  70. .. rst-class:: classref-enumeration-constant
  71. :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **COLOR_DEFAULT_BLACK** = ``1``
  72. Defaults to fully opaque black color.
  73. .. _class_VisualShaderNodeTextureParameter_constant_COLOR_DEFAULT_TRANSPARENT:
  74. .. rst-class:: classref-enumeration-constant
  75. :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **COLOR_DEFAULT_TRANSPARENT** = ``2``
  76. Defaults to fully transparent black color.
  77. .. _class_VisualShaderNodeTextureParameter_constant_COLOR_DEFAULT_MAX:
  78. .. rst-class:: classref-enumeration-constant
  79. :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **COLOR_DEFAULT_MAX** = ``3``
  80. Represents the size of the :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` enum.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _enum_VisualShaderNodeTextureParameter_TextureFilter:
  84. .. rst-class:: classref-enumeration
  85. enum **TextureFilter**:
  86. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_DEFAULT:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_DEFAULT** = ``0``
  89. Sample the texture using the filter determined by the node this shader is attached to.
  90. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST:
  91. .. rst-class:: classref-enumeration-constant
  92. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_NEAREST** = ``1``
  93. The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized.
  94. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR:
  95. .. rst-class:: classref-enumeration-constant
  96. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_LINEAR** = ``2``
  97. The texture filter blends between the nearest four pixels. Use this for most cases where you want to avoid a pixelated style.
  98. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP:
  99. .. rst-class:: classref-enumeration-constant
  100. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_NEAREST_MIPMAP** = ``3``
  101. The texture filter reads from the nearest pixel in the nearest mipmap. This is the fastest way to read from textures with mipmaps.
  102. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP:
  103. .. rst-class:: classref-enumeration-constant
  104. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_LINEAR_MIPMAP** = ``4``
  105. The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D<class_Camera2D>` zoom), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.
  106. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP_ANISOTROPIC:
  107. .. rst-class:: classref-enumeration-constant
  108. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_NEAREST_MIPMAP_ANISOTROPIC** = ``5``
  109. The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level<class_ProjectSettings_property_rendering/textures/default_filters/anisotropic_filtering_level>`.
  110. \ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_LINEAR_MIPMAP<class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP>` is usually more appropriate.
  111. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP_ANISOTROPIC:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_LINEAR_MIPMAP_ANISOTROPIC** = ``6``
  114. The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level<class_ProjectSettings_property_rendering/textures/default_filters/anisotropic_filtering_level>`.
  115. \ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_LINEAR_MIPMAP<class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP>` is usually more appropriate.
  116. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_MAX:
  117. .. rst-class:: classref-enumeration-constant
  118. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_MAX** = ``7``
  119. Represents the size of the :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` enum.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _enum_VisualShaderNodeTextureParameter_TextureRepeat:
  123. .. rst-class:: classref-enumeration
  124. enum **TextureRepeat**:
  125. .. _class_VisualShaderNodeTextureParameter_constant_REPEAT_DEFAULT:
  126. .. rst-class:: classref-enumeration-constant
  127. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_DEFAULT** = ``0``
  128. Sample the texture using the repeat mode determined by the node this shader is attached to.
  129. .. _class_VisualShaderNodeTextureParameter_constant_REPEAT_ENABLED:
  130. .. rst-class:: classref-enumeration-constant
  131. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_ENABLED** = ``1``
  132. Texture will repeat normally.
  133. .. _class_VisualShaderNodeTextureParameter_constant_REPEAT_DISABLED:
  134. .. rst-class:: classref-enumeration-constant
  135. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_DISABLED** = ``2``
  136. Texture will not repeat.
  137. .. _class_VisualShaderNodeTextureParameter_constant_REPEAT_MAX:
  138. .. rst-class:: classref-enumeration-constant
  139. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_MAX** = ``3``
  140. Represents the size of the :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` enum.
  141. .. rst-class:: classref-item-separator
  142. ----
  143. .. _enum_VisualShaderNodeTextureParameter_TextureSource:
  144. .. rst-class:: classref-enumeration
  145. enum **TextureSource**:
  146. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_NONE:
  147. .. rst-class:: classref-enumeration-constant
  148. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_NONE** = ``0``
  149. The texture source is not specified in the shader.
  150. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_SCREEN:
  151. .. rst-class:: classref-enumeration-constant
  152. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_SCREEN** = ``1``
  153. The texture source is the screen texture which captures all opaque objects drawn this frame.
  154. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_DEPTH:
  155. .. rst-class:: classref-enumeration-constant
  156. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_DEPTH** = ``2``
  157. The texture source is the depth texture from the depth prepass.
  158. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_NORMAL_ROUGHNESS:
  159. .. rst-class:: classref-enumeration-constant
  160. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_NORMAL_ROUGHNESS** = ``3``
  161. The texture source is the normal-roughness buffer from the depth prepass.
  162. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_MAX:
  163. .. rst-class:: classref-enumeration-constant
  164. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_MAX** = ``4``
  165. Represents the size of the :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` enum.
  166. .. rst-class:: classref-section-separator
  167. ----
  168. .. rst-class:: classref-descriptions-group
  169. Property Descriptions
  170. ---------------------
  171. .. _class_VisualShaderNodeTextureParameter_property_color_default:
  172. .. rst-class:: classref-property
  173. :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **color_default** = ``0``
  174. .. rst-class:: classref-property-setget
  175. - void **set_color_default** **(** :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` value **)**
  176. - :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **get_color_default** **(** **)**
  177. Sets the default color if no texture is assigned to the uniform.
  178. .. rst-class:: classref-item-separator
  179. ----
  180. .. _class_VisualShaderNodeTextureParameter_property_texture_filter:
  181. .. rst-class:: classref-property
  182. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **texture_filter** = ``0``
  183. .. rst-class:: classref-property-setget
  184. - void **set_texture_filter** **(** :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` value **)**
  185. - :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **get_texture_filter** **(** **)**
  186. Sets the texture filtering mode. See :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` for options.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_VisualShaderNodeTextureParameter_property_texture_repeat:
  190. .. rst-class:: classref-property
  191. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **texture_repeat** = ``0``
  192. .. rst-class:: classref-property-setget
  193. - void **set_texture_repeat** **(** :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` value **)**
  194. - :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **get_texture_repeat** **(** **)**
  195. Sets the texture repeating mode. See :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` for options.
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_VisualShaderNodeTextureParameter_property_texture_source:
  199. .. rst-class:: classref-property
  200. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **texture_source** = ``0``
  201. .. rst-class:: classref-property-setget
  202. - void **set_texture_source** **(** :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` value **)**
  203. - :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **get_texture_source** **(** **)**
  204. Sets the texture source mode. Used for reading from the screen, depth, or normal_roughness texture. See :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` for options.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_VisualShaderNodeTextureParameter_property_texture_type:
  208. .. rst-class:: classref-property
  209. :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **texture_type** = ``0``
  210. .. rst-class:: classref-property-setget
  211. - void **set_texture_type** **(** :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` value **)**
  212. - :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **get_texture_type** **(** **)**
  213. Defines the type of data provided by the source texture. See :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` for options.
  214. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  215. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  216. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  217. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  218. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  219. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  220. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`