class_visualshader.rst 27 KB

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