class_visualshadernodetexture.rst 6.0 KB

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