class_visualshadernodetexture.rst 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the VisualShaderNodeTexture.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_VisualShaderNodeTexture:
  6. VisualShaderNodeTexture
  7. =======================
  8. **Inherits:** :ref:`VisualShaderNode<class_VisualShaderNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Performs a 2D texture lookup within the visual shader graph.
  10. Description
  11. -----------
  12. Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from.
  13. Properties
  14. ----------
  15. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  16. | :ref:`Source<enum_VisualShaderNodeTexture_Source>` | :ref:`source<class_VisualShaderNodeTexture_property_source>` | ``0`` |
  17. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  18. | :ref:`Texture2D<class_Texture2D>` | :ref:`texture<class_VisualShaderNodeTexture_property_texture>` | |
  19. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  20. | :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` | :ref:`texture_type<class_VisualShaderNodeTexture_property_texture_type>` | ``0`` |
  21. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  22. Enumerations
  23. ------------
  24. .. _enum_VisualShaderNodeTexture_Source:
  25. .. _class_VisualShaderNodeTexture_constant_SOURCE_TEXTURE:
  26. .. _class_VisualShaderNodeTexture_constant_SOURCE_SCREEN:
  27. .. _class_VisualShaderNodeTexture_constant_SOURCE_2D_TEXTURE:
  28. .. _class_VisualShaderNodeTexture_constant_SOURCE_2D_NORMAL:
  29. .. _class_VisualShaderNodeTexture_constant_SOURCE_DEPTH:
  30. .. _class_VisualShaderNodeTexture_constant_SOURCE_PORT:
  31. .. _class_VisualShaderNodeTexture_constant_SOURCE_MAX:
  32. enum **Source**:
  33. - **SOURCE_TEXTURE** = **0** --- Use the texture given as an argument for this function.
  34. - **SOURCE_SCREEN** = **1** --- Use the current viewport's texture as the source.
  35. - **SOURCE_2D_TEXTURE** = **2** --- Use the texture from this shader's texture built-in (e.g. a texture of a :ref:`Sprite2D<class_Sprite2D>`).
  36. - **SOURCE_2D_NORMAL** = **3** --- Use the texture from this shader's normal map built-in.
  37. - **SOURCE_DEPTH** = **4** --- Use the depth texture available for this shader.
  38. - **SOURCE_PORT** = **5** --- Use the texture provided in the input port for this function.
  39. - **SOURCE_MAX** = **6** --- Represents the size of the :ref:`Source<enum_VisualShaderNodeTexture_Source>` enum.
  40. ----
  41. .. _enum_VisualShaderNodeTexture_TextureType:
  42. .. _class_VisualShaderNodeTexture_constant_TYPE_DATA:
  43. .. _class_VisualShaderNodeTexture_constant_TYPE_COLOR:
  44. .. _class_VisualShaderNodeTexture_constant_TYPE_NORMAL_MAP:
  45. .. _class_VisualShaderNodeTexture_constant_TYPE_MAX:
  46. enum **TextureType**:
  47. - **TYPE_DATA** = **0** --- No hints are added to the uniform declaration.
  48. - **TYPE_COLOR** = **1** --- Adds ``hint_albedo`` as hint to the uniform declaration for proper sRGB to linear conversion.
  49. - **TYPE_NORMAL_MAP** = **2** --- Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
  50. - **TYPE_MAX** = **3** --- Represents the size of the :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` enum.
  51. Property Descriptions
  52. ---------------------
  53. .. _class_VisualShaderNodeTexture_property_source:
  54. - :ref:`Source<enum_VisualShaderNodeTexture_Source>` **source**
  55. +-----------+-------------------+
  56. | *Default* | ``0`` |
  57. +-----------+-------------------+
  58. | *Setter* | set_source(value) |
  59. +-----------+-------------------+
  60. | *Getter* | get_source() |
  61. +-----------+-------------------+
  62. Determines the source for the lookup. See :ref:`Source<enum_VisualShaderNodeTexture_Source>` for options.
  63. ----
  64. .. _class_VisualShaderNodeTexture_property_texture:
  65. - :ref:`Texture2D<class_Texture2D>` **texture**
  66. +----------+--------------------+
  67. | *Setter* | set_texture(value) |
  68. +----------+--------------------+
  69. | *Getter* | get_texture() |
  70. +----------+--------------------+
  71. The source texture, if needed for the selected :ref:`source<class_VisualShaderNodeTexture_property_source>`.
  72. ----
  73. .. _class_VisualShaderNodeTexture_property_texture_type:
  74. - :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` **texture_type**
  75. +-----------+-------------------------+
  76. | *Default* | ``0`` |
  77. +-----------+-------------------------+
  78. | *Setter* | set_texture_type(value) |
  79. +-----------+-------------------------+
  80. | *Getter* | get_texture_type() |
  81. +-----------+-------------------------+
  82. 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.
  83. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  84. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  85. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  86. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  87. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  88. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`