class_rdshadersource.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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/RDShaderSource.xml.
  6. .. _class_RDShaderSource:
  7. RDShaderSource
  8. ==============
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Shader source code (used by :ref:`RenderingDevice<class_RenderingDevice>`).
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Shader source code in text form.
  15. See also :ref:`RDShaderFile<class_RDShaderFile>`. **RDShaderSource** is only meant to be used with the :ref:`RenderingDevice<class_RenderingDevice>` API. It should not be confused with Godot's own :ref:`Shader<class_Shader>` resource, which is what Godot's various nodes use for high-level shader programming.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+
  22. | :ref:`ShaderLanguage<enum_RenderingDevice_ShaderLanguage>` | :ref:`language<class_RDShaderSource_property_language>` | ``0`` |
  23. +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+
  24. | :ref:`String<class_String>` | :ref:`source_compute<class_RDShaderSource_property_source_compute>` | ``""`` |
  25. +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+
  26. | :ref:`String<class_String>` | :ref:`source_fragment<class_RDShaderSource_property_source_fragment>` | ``""`` |
  27. +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+
  28. | :ref:`String<class_String>` | :ref:`source_tesselation_control<class_RDShaderSource_property_source_tesselation_control>` | ``""`` |
  29. +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+
  30. | :ref:`String<class_String>` | :ref:`source_tesselation_evaluation<class_RDShaderSource_property_source_tesselation_evaluation>` | ``""`` |
  31. +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+
  32. | :ref:`String<class_String>` | :ref:`source_vertex<class_RDShaderSource_property_source_vertex>` | ``""`` |
  33. +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+
  34. .. rst-class:: classref-reftable-group
  35. Methods
  36. -------
  37. .. table::
  38. :widths: auto
  39. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`String<class_String>` | :ref:`get_stage_source<class_RDShaderSource_method_get_stage_source>`\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`\ ) |const| |
  41. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | |void| | :ref:`set_stage_source<class_RDShaderSource_method_set_stage_source>`\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`, source\: :ref:`String<class_String>`\ ) |
  43. +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. .. rst-class:: classref-section-separator
  45. ----
  46. .. rst-class:: classref-descriptions-group
  47. Property Descriptions
  48. ---------------------
  49. .. _class_RDShaderSource_property_language:
  50. .. rst-class:: classref-property
  51. :ref:`ShaderLanguage<enum_RenderingDevice_ShaderLanguage>` **language** = ``0`` :ref:`🔗<class_RDShaderSource_property_language>`
  52. .. rst-class:: classref-property-setget
  53. - |void| **set_language**\ (\ value\: :ref:`ShaderLanguage<enum_RenderingDevice_ShaderLanguage>`\ )
  54. - :ref:`ShaderLanguage<enum_RenderingDevice_ShaderLanguage>` **get_language**\ (\ )
  55. The language the shader is written in.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_RDShaderSource_property_source_compute:
  59. .. rst-class:: classref-property
  60. :ref:`String<class_String>` **source_compute** = ``""`` :ref:`🔗<class_RDShaderSource_property_source_compute>`
  61. .. rst-class:: classref-property-setget
  62. - |void| **set_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`, source\: :ref:`String<class_String>`\ )
  63. - :ref:`String<class_String>` **get_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`\ ) |const|
  64. Source code for the shader's compute stage.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_RDShaderSource_property_source_fragment:
  68. .. rst-class:: classref-property
  69. :ref:`String<class_String>` **source_fragment** = ``""`` :ref:`🔗<class_RDShaderSource_property_source_fragment>`
  70. .. rst-class:: classref-property-setget
  71. - |void| **set_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`, source\: :ref:`String<class_String>`\ )
  72. - :ref:`String<class_String>` **get_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`\ ) |const|
  73. Source code for the shader's fragment stage.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_RDShaderSource_property_source_tesselation_control:
  77. .. rst-class:: classref-property
  78. :ref:`String<class_String>` **source_tesselation_control** = ``""`` :ref:`🔗<class_RDShaderSource_property_source_tesselation_control>`
  79. .. rst-class:: classref-property-setget
  80. - |void| **set_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`, source\: :ref:`String<class_String>`\ )
  81. - :ref:`String<class_String>` **get_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`\ ) |const|
  82. Source code for the shader's tessellation control stage.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_RDShaderSource_property_source_tesselation_evaluation:
  86. .. rst-class:: classref-property
  87. :ref:`String<class_String>` **source_tesselation_evaluation** = ``""`` :ref:`🔗<class_RDShaderSource_property_source_tesselation_evaluation>`
  88. .. rst-class:: classref-property-setget
  89. - |void| **set_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`, source\: :ref:`String<class_String>`\ )
  90. - :ref:`String<class_String>` **get_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`\ ) |const|
  91. Source code for the shader's tessellation evaluation stage.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_RDShaderSource_property_source_vertex:
  95. .. rst-class:: classref-property
  96. :ref:`String<class_String>` **source_vertex** = ``""`` :ref:`🔗<class_RDShaderSource_property_source_vertex>`
  97. .. rst-class:: classref-property-setget
  98. - |void| **set_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`, source\: :ref:`String<class_String>`\ )
  99. - :ref:`String<class_String>` **get_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`\ ) |const|
  100. Source code for the shader's vertex stage.
  101. .. rst-class:: classref-section-separator
  102. ----
  103. .. rst-class:: classref-descriptions-group
  104. Method Descriptions
  105. -------------------
  106. .. _class_RDShaderSource_method_get_stage_source:
  107. .. rst-class:: classref-method
  108. :ref:`String<class_String>` **get_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`\ ) |const| :ref:`🔗<class_RDShaderSource_method_get_stage_source>`
  109. Returns source code for the specified shader ``stage``. Equivalent to getting one of :ref:`source_compute<class_RDShaderSource_property_source_compute>`, :ref:`source_fragment<class_RDShaderSource_property_source_fragment>`, :ref:`source_tesselation_control<class_RDShaderSource_property_source_tesselation_control>`, :ref:`source_tesselation_evaluation<class_RDShaderSource_property_source_tesselation_evaluation>` or :ref:`source_vertex<class_RDShaderSource_property_source_vertex>`.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_RDShaderSource_method_set_stage_source:
  113. .. rst-class:: classref-method
  114. |void| **set_stage_source**\ (\ stage\: :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>`, source\: :ref:`String<class_String>`\ ) :ref:`🔗<class_RDShaderSource_method_set_stage_source>`
  115. Sets ``source`` code for the specified shader ``stage``. Equivalent to setting one of :ref:`source_compute<class_RDShaderSource_property_source_compute>`, :ref:`source_fragment<class_RDShaderSource_property_source_fragment>`, :ref:`source_tesselation_control<class_RDShaderSource_property_source_tesselation_control>`, :ref:`source_tesselation_evaluation<class_RDShaderSource_property_source_tesselation_evaluation>` or :ref:`source_vertex<class_RDShaderSource_property_source_vertex>`.
  116. \ **Note:** If you set the compute shader source code using this method directly, remember to remove the Godot-specific hint ``#[compute]``.
  117. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  118. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  119. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  120. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  121. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  122. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  123. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  124. .. |void| replace:: :abbr:`void (No return value.)`