class_visualshadernodetexture.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. Performs a 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:`Texture<class_Texture>` | :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. enum **Source**:
  32. - **SOURCE_TEXTURE** = **0** --- Use the texture given as an argument for this function.
  33. - **SOURCE_SCREEN** = **1** --- Use the current viewport's texture as the source.
  34. - **SOURCE_2D_TEXTURE** = **2** --- Use the texture from this shader's texture built-in (e.g. a texture of a :ref:`Sprite<class_Sprite>`).
  35. - **SOURCE_2D_NORMAL** = **3** --- Use the texture from this shader's normal map built-in.
  36. - **SOURCE_DEPTH** = **4** --- Use the depth texture available for this shader.
  37. - **SOURCE_PORT** = **5** --- Use the texture provided in the input port for this function.
  38. ----
  39. .. _enum_VisualShaderNodeTexture_TextureType:
  40. .. _class_VisualShaderNodeTexture_constant_TYPE_DATA:
  41. .. _class_VisualShaderNodeTexture_constant_TYPE_COLOR:
  42. .. _class_VisualShaderNodeTexture_constant_TYPE_NORMALMAP:
  43. enum **TextureType**:
  44. - **TYPE_DATA** = **0** --- No hints are added to the uniform declaration.
  45. - **TYPE_COLOR** = **1** --- Adds ``hint_albedo`` as hint to the uniform declaration for proper sRGB to linear conversion.
  46. - **TYPE_NORMALMAP** = **2** --- Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
  47. Property Descriptions
  48. ---------------------
  49. .. _class_VisualShaderNodeTexture_property_source:
  50. - :ref:`Source<enum_VisualShaderNodeTexture_Source>` **source**
  51. +-----------+-------------------+
  52. | *Default* | ``0`` |
  53. +-----------+-------------------+
  54. | *Setter* | set_source(value) |
  55. +-----------+-------------------+
  56. | *Getter* | get_source() |
  57. +-----------+-------------------+
  58. Determines the source for the lookup. See :ref:`Source<enum_VisualShaderNodeTexture_Source>` for options.
  59. ----
  60. .. _class_VisualShaderNodeTexture_property_texture:
  61. - :ref:`Texture<class_Texture>` **texture**
  62. +----------+--------------------+
  63. | *Setter* | set_texture(value) |
  64. +----------+--------------------+
  65. | *Getter* | get_texture() |
  66. +----------+--------------------+
  67. The source texture, if needed for the selected :ref:`source<class_VisualShaderNodeTexture_property_source>`.
  68. ----
  69. .. _class_VisualShaderNodeTexture_property_texture_type:
  70. - :ref:`TextureType<enum_VisualShaderNodeTexture_TextureType>` **texture_type**
  71. +-----------+-------------------------+
  72. | *Default* | ``0`` |
  73. +-----------+-------------------------+
  74. | *Setter* | set_texture_type(value) |
  75. +-----------+-------------------------+
  76. | *Getter* | get_texture_type() |
  77. +-----------+-------------------------+
  78. 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.
  79. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  80. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  81. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`