class_visualshadernodetextureparameter.rst 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  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.3/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.3/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**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_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**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_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**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_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. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled).
  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 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled).
  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 and blends between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``). This makes the texture look pixelated from up close, and smooth from a distance.
  102. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D<class_Camera2D>` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.
  103. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_LINEAR_MIPMAP** = ``4``
  106. The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``). This makes the texture look smooth from up close, and smooth from a distance.
  107. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D<class_Camera2D>` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.
  108. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP_ANISOTROPIC:
  109. .. rst-class:: classref-enumeration-constant
  110. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_NEAREST_MIPMAP_ANISOTROPIC** = ``5``
  111. The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. 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>`.
  112. \ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_NEAREST_MIPMAP<class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP>` is usually more appropriate in this case.
  113. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP_ANISOTROPIC:
  114. .. rst-class:: classref-enumeration-constant
  115. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_LINEAR_MIPMAP_ANISOTROPIC** = ``6``
  116. The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. 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>`.
  117. \ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_LINEAR_MIPMAP<class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP>` is usually more appropriate in this case.
  118. .. _class_VisualShaderNodeTextureParameter_constant_FILTER_MAX:
  119. .. rst-class:: classref-enumeration-constant
  120. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_MAX** = ``7``
  121. Represents the size of the :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` enum.
  122. .. rst-class:: classref-item-separator
  123. ----
  124. .. _enum_VisualShaderNodeTextureParameter_TextureRepeat:
  125. .. rst-class:: classref-enumeration
  126. enum **TextureRepeat**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_TextureRepeat>`
  127. .. _class_VisualShaderNodeTextureParameter_constant_REPEAT_DEFAULT:
  128. .. rst-class:: classref-enumeration-constant
  129. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_DEFAULT** = ``0``
  130. Sample the texture using the repeat mode determined by the node this shader is attached to.
  131. .. _class_VisualShaderNodeTextureParameter_constant_REPEAT_ENABLED:
  132. .. rst-class:: classref-enumeration-constant
  133. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_ENABLED** = ``1``
  134. Texture will repeat normally.
  135. .. _class_VisualShaderNodeTextureParameter_constant_REPEAT_DISABLED:
  136. .. rst-class:: classref-enumeration-constant
  137. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_DISABLED** = ``2``
  138. Texture will not repeat.
  139. .. _class_VisualShaderNodeTextureParameter_constant_REPEAT_MAX:
  140. .. rst-class:: classref-enumeration-constant
  141. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_MAX** = ``3``
  142. Represents the size of the :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` enum.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _enum_VisualShaderNodeTextureParameter_TextureSource:
  146. .. rst-class:: classref-enumeration
  147. enum **TextureSource**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_TextureSource>`
  148. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_NONE:
  149. .. rst-class:: classref-enumeration-constant
  150. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_NONE** = ``0``
  151. The texture source is not specified in the shader.
  152. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_SCREEN:
  153. .. rst-class:: classref-enumeration-constant
  154. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_SCREEN** = ``1``
  155. The texture source is the screen texture which captures all opaque objects drawn this frame.
  156. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_DEPTH:
  157. .. rst-class:: classref-enumeration-constant
  158. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_DEPTH** = ``2``
  159. The texture source is the depth texture from the depth prepass.
  160. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_NORMAL_ROUGHNESS:
  161. .. rst-class:: classref-enumeration-constant
  162. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_NORMAL_ROUGHNESS** = ``3``
  163. The texture source is the normal-roughness buffer from the depth prepass.
  164. .. _class_VisualShaderNodeTextureParameter_constant_SOURCE_MAX:
  165. .. rst-class:: classref-enumeration-constant
  166. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_MAX** = ``4``
  167. Represents the size of the :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` enum.
  168. .. rst-class:: classref-section-separator
  169. ----
  170. .. rst-class:: classref-descriptions-group
  171. Property Descriptions
  172. ---------------------
  173. .. _class_VisualShaderNodeTextureParameter_property_color_default:
  174. .. rst-class:: classref-property
  175. :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **color_default** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_color_default>`
  176. .. rst-class:: classref-property-setget
  177. - |void| **set_color_default**\ (\ value\: :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>`\ )
  178. - :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **get_color_default**\ (\ )
  179. Sets the default color if no texture is assigned to the uniform.
  180. .. rst-class:: classref-item-separator
  181. ----
  182. .. _class_VisualShaderNodeTextureParameter_property_texture_filter:
  183. .. rst-class:: classref-property
  184. :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **texture_filter** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_texture_filter>`
  185. .. rst-class:: classref-property-setget
  186. - |void| **set_texture_filter**\ (\ value\: :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>`\ )
  187. - :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **get_texture_filter**\ (\ )
  188. Sets the texture filtering mode. See :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` for options.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_VisualShaderNodeTextureParameter_property_texture_repeat:
  192. .. rst-class:: classref-property
  193. :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **texture_repeat** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_texture_repeat>`
  194. .. rst-class:: classref-property-setget
  195. - |void| **set_texture_repeat**\ (\ value\: :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>`\ )
  196. - :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **get_texture_repeat**\ (\ )
  197. Sets the texture repeating mode. See :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` for options.
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_VisualShaderNodeTextureParameter_property_texture_source:
  201. .. rst-class:: classref-property
  202. :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **texture_source** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_texture_source>`
  203. .. rst-class:: classref-property-setget
  204. - |void| **set_texture_source**\ (\ value\: :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>`\ )
  205. - :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **get_texture_source**\ (\ )
  206. Sets the texture source mode. Used for reading from the screen, depth, or normal_roughness texture. See :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` for options.
  207. .. rst-class:: classref-item-separator
  208. ----
  209. .. _class_VisualShaderNodeTextureParameter_property_texture_type:
  210. .. rst-class:: classref-property
  211. :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **texture_type** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_texture_type>`
  212. .. rst-class:: classref-property-setget
  213. - |void| **set_texture_type**\ (\ value\: :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>`\ )
  214. - :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **get_texture_type**\ (\ )
  215. Defines the type of data provided by the source texture. See :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` for options.
  216. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  217. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  218. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  219. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  220. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  221. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  222. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  223. .. |void| replace:: :abbr:`void (No return value.)`