class_visualshader.rst 26 KB

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