class_visualshader.rst 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  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/VisualShader.xml.
  6. .. _class_VisualShader:
  7. VisualShader
  8. ============
  9. **Inherits:** :ref:`Shader<class_Shader>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A custom shader program with a visual editor.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This class provides a graph-like visual editor for creating a :ref:`Shader<class_Shader>`. Although **VisualShader**\ s do not require coding, they share the same logic with script shaders. They use :ref:`VisualShaderNode<class_VisualShaderNode>`\ s that can be connected to each other to control the flow of the shader. The visual shader graph is converted to a script shader behind the scenes.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`Using VisualShaders <../tutorials/shaders/visual_shaders>`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-------------------------------+---------------------------------------------------------------+
  25. | :ref:`Vector2<class_Vector2>` | :ref:`graph_offset<class_VisualShader_property_graph_offset>` |
  26. +-------------------------------+---------------------------------------------------------------+
  27. .. rst-class:: classref-reftable-group
  28. Methods
  29. -------
  30. .. table::
  31. :widths: auto
  32. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | |void| | :ref:`add_node<class_VisualShader_method_add_node>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, node\: :ref:`VisualShaderNode<class_VisualShaderNode>`, position\: :ref:`Vector2<class_Vector2>`, id\: :ref:`int<class_int>`\ ) |
  34. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | |void| | :ref:`add_varying<class_VisualShader_method_add_varying>`\ (\ name\: :ref:`String<class_String>`, mode\: :ref:`VaryingMode<enum_VisualShader_VaryingMode>`, type\: :ref:`VaryingType<enum_VisualShader_VaryingType>`\ ) |
  36. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | |void| | :ref:`attach_node_to_frame<class_VisualShader_method_attach_node_to_frame>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`, frame\: :ref:`int<class_int>`\ ) |
  38. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`can_connect_nodes<class_VisualShader_method_can_connect_nodes>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) |const| |
  40. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect_nodes<class_VisualShader_method_connect_nodes>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) |
  42. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | |void| | :ref:`connect_nodes_forced<class_VisualShader_method_connect_nodes_forced>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) |
  44. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | |void| | :ref:`detach_node_from_frame<class_VisualShader_method_detach_node_from_frame>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |
  46. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | |void| | :ref:`disconnect_nodes<class_VisualShader_method_disconnect_nodes>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) |
  48. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`VisualShaderNode<class_VisualShaderNode>` | :ref:`get_node<class_VisualShader_method_get_node>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |const| |
  50. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] | :ref:`get_node_connections<class_VisualShader_method_get_node_connections>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| |
  52. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_node_list<class_VisualShader_method_get_node_list>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| |
  54. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_VisualShader_method_get_node_position>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |const| |
  56. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`int<class_int>` | :ref:`get_valid_node_id<class_VisualShader_method_get_valid_node_id>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| |
  58. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`has_varying<class_VisualShader_method_has_varying>`\ (\ name\: :ref:`String<class_String>`\ ) |const| |
  60. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`is_node_connection<class_VisualShader_method_is_node_connection>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) |const| |
  62. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | |void| | :ref:`remove_node<class_VisualShader_method_remove_node>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |
  64. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | |void| | :ref:`remove_varying<class_VisualShader_method_remove_varying>`\ (\ name\: :ref:`String<class_String>`\ ) |
  66. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | |void| | :ref:`replace_node<class_VisualShader_method_replace_node>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`, new_class\: :ref:`StringName<class_StringName>`\ ) |
  68. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | |void| | :ref:`set_mode<class_VisualShader_method_set_mode>`\ (\ mode\: :ref:`Mode<enum_Shader_Mode>`\ ) |
  70. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | |void| | :ref:`set_node_position<class_VisualShader_method_set_node_position>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`, position\: :ref:`Vector2<class_Vector2>`\ ) |
  72. +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. .. rst-class:: classref-section-separator
  74. ----
  75. .. rst-class:: classref-descriptions-group
  76. Enumerations
  77. ------------
  78. .. _enum_VisualShader_Type:
  79. .. rst-class:: classref-enumeration
  80. enum **Type**: :ref:`🔗<enum_VisualShader_Type>`
  81. .. _class_VisualShader_constant_TYPE_VERTEX:
  82. .. rst-class:: classref-enumeration-constant
  83. :ref:`Type<enum_VisualShader_Type>` **TYPE_VERTEX** = ``0``
  84. A vertex shader, operating on vertices.
  85. .. _class_VisualShader_constant_TYPE_FRAGMENT:
  86. .. rst-class:: classref-enumeration-constant
  87. :ref:`Type<enum_VisualShader_Type>` **TYPE_FRAGMENT** = ``1``
  88. A fragment shader, operating on fragments (pixels).
  89. .. _class_VisualShader_constant_TYPE_LIGHT:
  90. .. rst-class:: classref-enumeration-constant
  91. :ref:`Type<enum_VisualShader_Type>` **TYPE_LIGHT** = ``2``
  92. A shader for light calculations.
  93. .. _class_VisualShader_constant_TYPE_START:
  94. .. rst-class:: classref-enumeration-constant
  95. :ref:`Type<enum_VisualShader_Type>` **TYPE_START** = ``3``
  96. A function for the "start" stage of particle shader.
  97. .. _class_VisualShader_constant_TYPE_PROCESS:
  98. .. rst-class:: classref-enumeration-constant
  99. :ref:`Type<enum_VisualShader_Type>` **TYPE_PROCESS** = ``4``
  100. A function for the "process" stage of particle shader.
  101. .. _class_VisualShader_constant_TYPE_COLLIDE:
  102. .. rst-class:: classref-enumeration-constant
  103. :ref:`Type<enum_VisualShader_Type>` **TYPE_COLLIDE** = ``5``
  104. A function for the "collide" stage (particle collision handler) of particle shader.
  105. .. _class_VisualShader_constant_TYPE_START_CUSTOM:
  106. .. rst-class:: classref-enumeration-constant
  107. :ref:`Type<enum_VisualShader_Type>` **TYPE_START_CUSTOM** = ``6``
  108. A function for the "start" stage of particle shader, with customized output.
  109. .. _class_VisualShader_constant_TYPE_PROCESS_CUSTOM:
  110. .. rst-class:: classref-enumeration-constant
  111. :ref:`Type<enum_VisualShader_Type>` **TYPE_PROCESS_CUSTOM** = ``7``
  112. A function for the "process" stage of particle shader, with customized output.
  113. .. _class_VisualShader_constant_TYPE_SKY:
  114. .. rst-class:: classref-enumeration-constant
  115. :ref:`Type<enum_VisualShader_Type>` **TYPE_SKY** = ``8``
  116. A shader for 3D environment's sky.
  117. .. _class_VisualShader_constant_TYPE_FOG:
  118. .. rst-class:: classref-enumeration-constant
  119. :ref:`Type<enum_VisualShader_Type>` **TYPE_FOG** = ``9``
  120. A compute shader that runs for each froxel of the volumetric fog map.
  121. .. _class_VisualShader_constant_TYPE_MAX:
  122. .. rst-class:: classref-enumeration-constant
  123. :ref:`Type<enum_VisualShader_Type>` **TYPE_MAX** = ``10``
  124. Represents the size of the :ref:`Type<enum_VisualShader_Type>` enum.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _enum_VisualShader_VaryingMode:
  128. .. rst-class:: classref-enumeration
  129. enum **VaryingMode**: :ref:`🔗<enum_VisualShader_VaryingMode>`
  130. .. _class_VisualShader_constant_VARYING_MODE_VERTEX_TO_FRAG_LIGHT:
  131. .. rst-class:: classref-enumeration-constant
  132. :ref:`VaryingMode<enum_VisualShader_VaryingMode>` **VARYING_MODE_VERTEX_TO_FRAG_LIGHT** = ``0``
  133. Varying is passed from ``Vertex`` function to ``Fragment`` and ``Light`` functions.
  134. .. _class_VisualShader_constant_VARYING_MODE_FRAG_TO_LIGHT:
  135. .. rst-class:: classref-enumeration-constant
  136. :ref:`VaryingMode<enum_VisualShader_VaryingMode>` **VARYING_MODE_FRAG_TO_LIGHT** = ``1``
  137. Varying is passed from ``Fragment`` function to ``Light`` function.
  138. .. _class_VisualShader_constant_VARYING_MODE_MAX:
  139. .. rst-class:: classref-enumeration-constant
  140. :ref:`VaryingMode<enum_VisualShader_VaryingMode>` **VARYING_MODE_MAX** = ``2``
  141. Represents the size of the :ref:`VaryingMode<enum_VisualShader_VaryingMode>` enum.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _enum_VisualShader_VaryingType:
  145. .. rst-class:: classref-enumeration
  146. enum **VaryingType**: :ref:`🔗<enum_VisualShader_VaryingType>`
  147. .. _class_VisualShader_constant_VARYING_TYPE_FLOAT:
  148. .. rst-class:: classref-enumeration-constant
  149. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_FLOAT** = ``0``
  150. Varying is of type :ref:`float<class_float>`.
  151. .. _class_VisualShader_constant_VARYING_TYPE_INT:
  152. .. rst-class:: classref-enumeration-constant
  153. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_INT** = ``1``
  154. Varying is of type :ref:`int<class_int>`.
  155. .. _class_VisualShader_constant_VARYING_TYPE_UINT:
  156. .. rst-class:: classref-enumeration-constant
  157. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_UINT** = ``2``
  158. Varying is of type unsigned :ref:`int<class_int>`.
  159. .. _class_VisualShader_constant_VARYING_TYPE_VECTOR_2D:
  160. .. rst-class:: classref-enumeration-constant
  161. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_VECTOR_2D** = ``3``
  162. Varying is of type :ref:`Vector2<class_Vector2>`.
  163. .. _class_VisualShader_constant_VARYING_TYPE_VECTOR_3D:
  164. .. rst-class:: classref-enumeration-constant
  165. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_VECTOR_3D** = ``4``
  166. Varying is of type :ref:`Vector3<class_Vector3>`.
  167. .. _class_VisualShader_constant_VARYING_TYPE_VECTOR_4D:
  168. .. rst-class:: classref-enumeration-constant
  169. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_VECTOR_4D** = ``5``
  170. Varying is of type :ref:`Vector4<class_Vector4>`.
  171. .. _class_VisualShader_constant_VARYING_TYPE_BOOLEAN:
  172. .. rst-class:: classref-enumeration-constant
  173. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_BOOLEAN** = ``6``
  174. Varying is of type :ref:`bool<class_bool>`.
  175. .. _class_VisualShader_constant_VARYING_TYPE_TRANSFORM:
  176. .. rst-class:: classref-enumeration-constant
  177. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_TRANSFORM** = ``7``
  178. Varying is of type :ref:`Transform3D<class_Transform3D>`.
  179. .. _class_VisualShader_constant_VARYING_TYPE_MAX:
  180. .. rst-class:: classref-enumeration-constant
  181. :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_MAX** = ``8``
  182. Represents the size of the :ref:`VaryingType<enum_VisualShader_VaryingType>` enum.
  183. .. rst-class:: classref-section-separator
  184. ----
  185. .. rst-class:: classref-descriptions-group
  186. Constants
  187. ---------
  188. .. _class_VisualShader_constant_NODE_ID_INVALID:
  189. .. rst-class:: classref-constant
  190. **NODE_ID_INVALID** = ``-1`` :ref:`🔗<class_VisualShader_constant_NODE_ID_INVALID>`
  191. Indicates an invalid **VisualShader** node.
  192. .. _class_VisualShader_constant_NODE_ID_OUTPUT:
  193. .. rst-class:: classref-constant
  194. **NODE_ID_OUTPUT** = ``0`` :ref:`🔗<class_VisualShader_constant_NODE_ID_OUTPUT>`
  195. Indicates an output node of **VisualShader**.
  196. .. rst-class:: classref-section-separator
  197. ----
  198. .. rst-class:: classref-descriptions-group
  199. Property Descriptions
  200. ---------------------
  201. .. _class_VisualShader_property_graph_offset:
  202. .. rst-class:: classref-property
  203. :ref:`Vector2<class_Vector2>` **graph_offset** :ref:`🔗<class_VisualShader_property_graph_offset>`
  204. .. rst-class:: classref-property-setget
  205. - |void| **set_graph_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  206. - :ref:`Vector2<class_Vector2>` **get_graph_offset**\ (\ )
  207. **Deprecated:** This property does nothing and always equals to zero.
  208. Deprecated.
  209. .. rst-class:: classref-section-separator
  210. ----
  211. .. rst-class:: classref-descriptions-group
  212. Method Descriptions
  213. -------------------
  214. .. _class_VisualShader_method_add_node:
  215. .. rst-class:: classref-method
  216. |void| **add_node**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, node\: :ref:`VisualShaderNode<class_VisualShaderNode>`, position\: :ref:`Vector2<class_Vector2>`, id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_add_node>`
  217. Adds the specified ``node`` to the shader.
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_VisualShader_method_add_varying:
  221. .. rst-class:: classref-method
  222. |void| **add_varying**\ (\ name\: :ref:`String<class_String>`, mode\: :ref:`VaryingMode<enum_VisualShader_VaryingMode>`, type\: :ref:`VaryingType<enum_VisualShader_VaryingType>`\ ) :ref:`🔗<class_VisualShader_method_add_varying>`
  223. Adds a new varying value node to the shader.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_VisualShader_method_attach_node_to_frame:
  227. .. rst-class:: classref-method
  228. |void| **attach_node_to_frame**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`, frame\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_attach_node_to_frame>`
  229. Attaches the given node to the given frame.
  230. .. rst-class:: classref-item-separator
  231. ----
  232. .. _class_VisualShader_method_can_connect_nodes:
  233. .. rst-class:: classref-method
  234. :ref:`bool<class_bool>` **can_connect_nodes**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_VisualShader_method_can_connect_nodes>`
  235. Returns ``true`` if the specified nodes and ports can be connected together.
  236. .. rst-class:: classref-item-separator
  237. ----
  238. .. _class_VisualShader_method_connect_nodes:
  239. .. rst-class:: classref-method
  240. :ref:`Error<enum_@GlobalScope_Error>` **connect_nodes**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_connect_nodes>`
  241. Connects the specified nodes and ports.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _class_VisualShader_method_connect_nodes_forced:
  245. .. rst-class:: classref-method
  246. |void| **connect_nodes_forced**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_connect_nodes_forced>`
  247. Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly.
  248. .. rst-class:: classref-item-separator
  249. ----
  250. .. _class_VisualShader_method_detach_node_from_frame:
  251. .. rst-class:: classref-method
  252. |void| **detach_node_from_frame**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_detach_node_from_frame>`
  253. Detaches the given node from the frame it is attached to.
  254. .. rst-class:: classref-item-separator
  255. ----
  256. .. _class_VisualShader_method_disconnect_nodes:
  257. .. rst-class:: classref-method
  258. |void| **disconnect_nodes**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_disconnect_nodes>`
  259. Connects the specified nodes and ports.
  260. .. rst-class:: classref-item-separator
  261. ----
  262. .. _class_VisualShader_method_get_node:
  263. .. rst-class:: classref-method
  264. :ref:`VisualShaderNode<class_VisualShaderNode>` **get_node**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_VisualShader_method_get_node>`
  265. Returns the shader node instance with specified ``type`` and ``id``.
  266. .. rst-class:: classref-item-separator
  267. ----
  268. .. _class_VisualShader_method_get_node_connections:
  269. .. rst-class:: classref-method
  270. :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] **get_node_connections**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| :ref:`🔗<class_VisualShader_method_get_node_connections>`
  271. Returns the list of connected nodes with the specified type.
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _class_VisualShader_method_get_node_list:
  275. .. rst-class:: classref-method
  276. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_node_list**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| :ref:`🔗<class_VisualShader_method_get_node_list>`
  277. Returns the list of all nodes in the shader with the specified type.
  278. .. rst-class:: classref-item-separator
  279. ----
  280. .. _class_VisualShader_method_get_node_position:
  281. .. rst-class:: classref-method
  282. :ref:`Vector2<class_Vector2>` **get_node_position**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_VisualShader_method_get_node_position>`
  283. Returns the position of the specified node within the shader graph.
  284. .. rst-class:: classref-item-separator
  285. ----
  286. .. _class_VisualShader_method_get_valid_node_id:
  287. .. rst-class:: classref-method
  288. :ref:`int<class_int>` **get_valid_node_id**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| :ref:`🔗<class_VisualShader_method_get_valid_node_id>`
  289. Returns next valid node ID that can be added to the shader graph.
  290. .. rst-class:: classref-item-separator
  291. ----
  292. .. _class_VisualShader_method_has_varying:
  293. .. rst-class:: classref-method
  294. :ref:`bool<class_bool>` **has_varying**\ (\ name\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_VisualShader_method_has_varying>`
  295. Returns ``true`` if the shader has a varying with the given ``name``.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_VisualShader_method_is_node_connection:
  299. .. rst-class:: classref-method
  300. :ref:`bool<class_bool>` **is_node_connection**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, from_node\: :ref:`int<class_int>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`int<class_int>`, to_port\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_VisualShader_method_is_node_connection>`
  301. Returns ``true`` if the specified node and port connection exist.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _class_VisualShader_method_remove_node:
  305. .. rst-class:: classref-method
  306. |void| **remove_node**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_remove_node>`
  307. Removes the specified node from the shader.
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_VisualShader_method_remove_varying:
  311. .. rst-class:: classref-method
  312. |void| **remove_varying**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_VisualShader_method_remove_varying>`
  313. Removes a varying value node with the given ``name``. Prints an error if a node with this name is not found.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_VisualShader_method_replace_node:
  317. .. rst-class:: classref-method
  318. |void| **replace_node**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`, new_class\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_VisualShader_method_replace_node>`
  319. Replaces the specified node with a node of new class type.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_VisualShader_method_set_mode:
  323. .. rst-class:: classref-method
  324. |void| **set_mode**\ (\ mode\: :ref:`Mode<enum_Shader_Mode>`\ ) :ref:`🔗<class_VisualShader_method_set_mode>`
  325. Sets the mode of this shader.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_VisualShader_method_set_node_position:
  329. .. rst-class:: classref-method
  330. |void| **set_node_position**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`, position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_VisualShader_method_set_node_position>`
  331. Sets the position of the specified node.
  332. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  333. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  334. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  335. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  336. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  337. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  338. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  339. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  340. .. |void| replace:: :abbr:`void (No return value.)`