class_visualshadernodetexture.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/VisualShaderNodeTexture.xml.
  6. .. _class_VisualShaderNodeTexture:
  7. VisualShaderNodeTexture
  8. =======================
  9. **Inherits:** :ref:`VisualShaderNode<class_VisualShaderNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Performs a 2D texture lookup within the visual shader graph.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  21. | :ref:`Source<enum_VisualShaderNodeTexture_Source>` | :ref:`source<class_VisualShaderNodeTexture_property_source>` | ``0`` |
  22. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  23. | :ref:`Texture2D<class_Texture2D>` | :ref:`texture<class_VisualShaderNodeTexture_property_texture>` | |
  24. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  25. | :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` | :ref:`texture_type<class_VisualShaderNodeTexture_property_texture_type>` | ``0`` |
  26. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  27. .. rst-class:: classref-section-separator
  28. ----
  29. .. rst-class:: classref-descriptions-group
  30. Enumerations
  31. ------------
  32. .. _enum_VisualShaderNodeTexture_Source:
  33. .. rst-class:: classref-enumeration
  34. enum **Source**:
  35. .. _class_VisualShaderNodeTexture_constant_SOURCE_TEXTURE:
  36. .. rst-class:: classref-enumeration-constant
  37. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_TEXTURE** = ``0``
  38. Use the texture given as an argument for this function.
  39. .. _class_VisualShaderNodeTexture_constant_SOURCE_SCREEN:
  40. .. rst-class:: classref-enumeration-constant
  41. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_SCREEN** = ``1``
  42. Use the current viewport's texture as the source.
  43. .. _class_VisualShaderNodeTexture_constant_SOURCE_2D_TEXTURE:
  44. .. rst-class:: classref-enumeration-constant
  45. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_2D_TEXTURE** = ``2``
  46. Use the texture from this shader's texture built-in (e.g. a texture of a :ref:`Sprite2D<class_Sprite2D>`).
  47. .. _class_VisualShaderNodeTexture_constant_SOURCE_2D_NORMAL:
  48. .. rst-class:: classref-enumeration-constant
  49. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_2D_NORMAL** = ``3``
  50. Use the texture from this shader's normal map built-in.
  51. .. _class_VisualShaderNodeTexture_constant_SOURCE_DEPTH:
  52. .. rst-class:: classref-enumeration-constant
  53. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_DEPTH** = ``4``
  54. Use the depth texture captured during the depth prepass. Only available when the depth prepass is used (i.e. in spatial shaders and in the forward_plus or gl_compatibility renderers).
  55. .. _class_VisualShaderNodeTexture_constant_SOURCE_PORT:
  56. .. rst-class:: classref-enumeration-constant
  57. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_PORT** = ``5``
  58. Use the texture provided in the input port for this function.
  59. .. _class_VisualShaderNodeTexture_constant_SOURCE_3D_NORMAL:
  60. .. rst-class:: classref-enumeration-constant
  61. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_3D_NORMAL** = ``6``
  62. Use the normal buffer captured during the depth prepass. Only available when the normal-roughness buffer is available (i.e. in spatial shaders and in the forward_plus renderer).
  63. .. _class_VisualShaderNodeTexture_constant_SOURCE_ROUGHNESS:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_ROUGHNESS** = ``7``
  66. Use the roughness buffer captured during the depth prepass. Only available when the normal-roughness buffer is available (i.e. in spatial shaders and in the forward_plus renderer).
  67. .. _class_VisualShaderNodeTexture_constant_SOURCE_MAX:
  68. .. rst-class:: classref-enumeration-constant
  69. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **SOURCE_MAX** = ``8``
  70. Represents the size of the :ref:`Source<enum_VisualShaderNodeTexture_Source>` enum.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _enum_VisualShaderNodeTexture_TextureType:
  74. .. rst-class:: classref-enumeration
  75. enum **TextureType**:
  76. .. _class_VisualShaderNodeTexture_constant_TYPE_DATA:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` **TYPE_DATA** = ``0``
  79. No hints are added to the uniform declaration.
  80. .. _class_VisualShaderNodeTexture_constant_TYPE_COLOR:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` **TYPE_COLOR** = ``1``
  83. Adds ``source_color`` as hint to the uniform declaration for proper sRGB to linear conversion.
  84. .. _class_VisualShaderNodeTexture_constant_TYPE_NORMAL_MAP:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` **TYPE_NORMAL_MAP** = ``2``
  87. Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
  88. .. _class_VisualShaderNodeTexture_constant_TYPE_MAX:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` **TYPE_MAX** = ``3``
  91. Represents the size of the :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` enum.
  92. .. rst-class:: classref-section-separator
  93. ----
  94. .. rst-class:: classref-descriptions-group
  95. Property Descriptions
  96. ---------------------
  97. .. _class_VisualShaderNodeTexture_property_source:
  98. .. rst-class:: classref-property
  99. :ref:`Source<enum_VisualShaderNodeTexture_Source>` **source** = ``0``
  100. .. rst-class:: classref-property-setget
  101. - void **set_source** **(** :ref:`Source<enum_VisualShaderNodeTexture_Source>` value **)**
  102. - :ref:`Source<enum_VisualShaderNodeTexture_Source>` **get_source** **(** **)**
  103. Determines the source for the lookup. See :ref:`Source<enum_VisualShaderNodeTexture_Source>` for options.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_VisualShaderNodeTexture_property_texture:
  107. .. rst-class:: classref-property
  108. :ref:`Texture2D<class_Texture2D>` **texture**
  109. .. rst-class:: classref-property-setget
  110. - void **set_texture** **(** :ref:`Texture2D<class_Texture2D>` value **)**
  111. - :ref:`Texture2D<class_Texture2D>` **get_texture** **(** **)**
  112. The source texture, if needed for the selected :ref:`source<class_VisualShaderNodeTexture_property_source>`.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_VisualShaderNodeTexture_property_texture_type:
  116. .. rst-class:: classref-property
  117. :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` **texture_type** = ``0``
  118. .. rst-class:: classref-property-setget
  119. - void **set_texture_type** **(** :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` value **)**
  120. - :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` **get_texture_type** **(** **)**
  121. Specifies the type of the texture if :ref:`source<class_VisualShaderNodeTexture_property_source>` is set to :ref:`SOURCE_TEXTURE<class_VisualShaderNodeTexture_constant_SOURCE_TEXTURE>`. See :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` for options.
  122. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  123. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  124. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  125. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  126. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  127. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  128. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`