123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/VisualShader.xml.
- .. _class_VisualShader:
- VisualShader
- ============
- **Inherits:** :ref:`Shader<class_Shader>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- A custom shader program with a visual editor.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- 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.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`Using VisualShaders <../tutorials/shaders/visual_shaders>`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-------------------------------+---------------------------------------------------------------+-------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`graph_offset<class_VisualShader_property_graph_offset>` | ``Vector2(0, 0)`` |
- +-------------------------------+---------------------------------------------------------------+-------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |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>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |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>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |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>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |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>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`detach_node_from_frame<class_VisualShader_method_detach_node_from_frame>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |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>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`VisualShaderNode<class_VisualShaderNode>` | :ref:`get_node<class_VisualShader_method_get_node>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |const| |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_node_list<class_VisualShader_method_get_node_list>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_valid_node_id<class_VisualShader_method_get_valid_node_id>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_varying<class_VisualShader_method_has_varying>`\ (\ name\: :ref:`String<class_String>`\ ) |const| |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :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| |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`remove_node<class_VisualShader_method_remove_node>`\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`remove_varying<class_VisualShader_method_remove_varying>`\ (\ name\: :ref:`String<class_String>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |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>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |void| | :ref:`set_mode<class_VisualShader_method_set_mode>`\ (\ mode\: :ref:`Mode<enum_Shader_Mode>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | |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>`\ ) |
- +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_VisualShader_Type:
- .. rst-class:: classref-enumeration
- enum **Type**: :ref:`🔗<enum_VisualShader_Type>`
- .. _class_VisualShader_constant_TYPE_VERTEX:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_VERTEX** = ``0``
- A vertex shader, operating on vertices.
- .. _class_VisualShader_constant_TYPE_FRAGMENT:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_FRAGMENT** = ``1``
- A fragment shader, operating on fragments (pixels).
- .. _class_VisualShader_constant_TYPE_LIGHT:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_LIGHT** = ``2``
- A shader for light calculations.
- .. _class_VisualShader_constant_TYPE_START:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_START** = ``3``
- A function for the "start" stage of particle shader.
- .. _class_VisualShader_constant_TYPE_PROCESS:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_PROCESS** = ``4``
- A function for the "process" stage of particle shader.
- .. _class_VisualShader_constant_TYPE_COLLIDE:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_COLLIDE** = ``5``
- A function for the "collide" stage (particle collision handler) of particle shader.
- .. _class_VisualShader_constant_TYPE_START_CUSTOM:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_START_CUSTOM** = ``6``
- A function for the "start" stage of particle shader, with customized output.
- .. _class_VisualShader_constant_TYPE_PROCESS_CUSTOM:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_PROCESS_CUSTOM** = ``7``
- A function for the "process" stage of particle shader, with customized output.
- .. _class_VisualShader_constant_TYPE_SKY:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_SKY** = ``8``
- A shader for 3D environment's sky.
- .. _class_VisualShader_constant_TYPE_FOG:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_FOG** = ``9``
- A compute shader that runs for each froxel of the volumetric fog map.
- .. _class_VisualShader_constant_TYPE_MAX:
- .. rst-class:: classref-enumeration-constant
- :ref:`Type<enum_VisualShader_Type>` **TYPE_MAX** = ``10``
- Represents the size of the :ref:`Type<enum_VisualShader_Type>` enum.
- .. rst-class:: classref-item-separator
- ----
- .. _enum_VisualShader_VaryingMode:
- .. rst-class:: classref-enumeration
- enum **VaryingMode**: :ref:`🔗<enum_VisualShader_VaryingMode>`
- .. _class_VisualShader_constant_VARYING_MODE_VERTEX_TO_FRAG_LIGHT:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingMode<enum_VisualShader_VaryingMode>` **VARYING_MODE_VERTEX_TO_FRAG_LIGHT** = ``0``
- Varying is passed from ``Vertex`` function to ``Fragment`` and ``Light`` functions.
- .. _class_VisualShader_constant_VARYING_MODE_FRAG_TO_LIGHT:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingMode<enum_VisualShader_VaryingMode>` **VARYING_MODE_FRAG_TO_LIGHT** = ``1``
- Varying is passed from ``Fragment`` function to ``Light`` function.
- .. _class_VisualShader_constant_VARYING_MODE_MAX:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingMode<enum_VisualShader_VaryingMode>` **VARYING_MODE_MAX** = ``2``
- Represents the size of the :ref:`VaryingMode<enum_VisualShader_VaryingMode>` enum.
- .. rst-class:: classref-item-separator
- ----
- .. _enum_VisualShader_VaryingType:
- .. rst-class:: classref-enumeration
- enum **VaryingType**: :ref:`🔗<enum_VisualShader_VaryingType>`
- .. _class_VisualShader_constant_VARYING_TYPE_FLOAT:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_FLOAT** = ``0``
- Varying is of type :ref:`float<class_float>`.
- .. _class_VisualShader_constant_VARYING_TYPE_INT:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_INT** = ``1``
- Varying is of type :ref:`int<class_int>`.
- .. _class_VisualShader_constant_VARYING_TYPE_UINT:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_UINT** = ``2``
- Varying is of type unsigned :ref:`int<class_int>`.
- .. _class_VisualShader_constant_VARYING_TYPE_VECTOR_2D:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_VECTOR_2D** = ``3``
- Varying is of type :ref:`Vector2<class_Vector2>`.
- .. _class_VisualShader_constant_VARYING_TYPE_VECTOR_3D:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_VECTOR_3D** = ``4``
- Varying is of type :ref:`Vector3<class_Vector3>`.
- .. _class_VisualShader_constant_VARYING_TYPE_VECTOR_4D:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_VECTOR_4D** = ``5``
- Varying is of type :ref:`Vector4<class_Vector4>`.
- .. _class_VisualShader_constant_VARYING_TYPE_BOOLEAN:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_BOOLEAN** = ``6``
- Varying is of type :ref:`bool<class_bool>`.
- .. _class_VisualShader_constant_VARYING_TYPE_TRANSFORM:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_TRANSFORM** = ``7``
- Varying is of type :ref:`Transform3D<class_Transform3D>`.
- .. _class_VisualShader_constant_VARYING_TYPE_MAX:
- .. rst-class:: classref-enumeration-constant
- :ref:`VaryingType<enum_VisualShader_VaryingType>` **VARYING_TYPE_MAX** = ``8``
- Represents the size of the :ref:`VaryingType<enum_VisualShader_VaryingType>` enum.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Constants
- ---------
- .. _class_VisualShader_constant_NODE_ID_INVALID:
- .. rst-class:: classref-constant
- **NODE_ID_INVALID** = ``-1`` :ref:`🔗<class_VisualShader_constant_NODE_ID_INVALID>`
- Indicates an invalid **VisualShader** node.
- .. _class_VisualShader_constant_NODE_ID_OUTPUT:
- .. rst-class:: classref-constant
- **NODE_ID_OUTPUT** = ``0`` :ref:`🔗<class_VisualShader_constant_NODE_ID_OUTPUT>`
- Indicates an output node of **VisualShader**.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_VisualShader_property_graph_offset:
- .. rst-class:: classref-property
- :ref:`Vector2<class_Vector2>` **graph_offset** = ``Vector2(0, 0)`` :ref:`🔗<class_VisualShader_property_graph_offset>`
- .. rst-class:: classref-property-setget
- - |void| **set_graph_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- - :ref:`Vector2<class_Vector2>` **get_graph_offset**\ (\ )
- The offset vector of the whole graph.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_VisualShader_method_add_node:
- .. rst-class:: classref-method
- |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>`
- Adds the specified ``node`` to the shader.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_add_varying:
- .. rst-class:: classref-method
- |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>`
- Adds a new varying value node to the shader.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_attach_node_to_frame:
- .. rst-class:: classref-method
- |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>`
- Attaches the given node to the given frame.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_can_connect_nodes:
- .. rst-class:: classref-method
- :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>`
- Returns ``true`` if the specified nodes and ports can be connected together.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_connect_nodes:
- .. rst-class:: classref-method
- :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>`
- Connects the specified nodes and ports.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_connect_nodes_forced:
- .. rst-class:: classref-method
- |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>`
- Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_detach_node_from_frame:
- .. rst-class:: classref-method
- |void| **detach_node_from_frame**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_detach_node_from_frame>`
- Detaches the given node from the frame it is attached to.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_disconnect_nodes:
- .. rst-class:: classref-method
- |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>`
- Connects the specified nodes and ports.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_get_node:
- .. rst-class:: classref-method
- :ref:`VisualShaderNode<class_VisualShaderNode>` **get_node**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_VisualShader_method_get_node>`
- Returns the shader node instance with specified ``type`` and ``id``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_get_node_connections:
- .. rst-class:: classref-method
- :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>`
- Returns the list of connected nodes with the specified type.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_get_node_list:
- .. rst-class:: classref-method
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_node_list**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| :ref:`🔗<class_VisualShader_method_get_node_list>`
- Returns the list of all nodes in the shader with the specified type.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_get_node_position:
- .. rst-class:: classref-method
- :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>`
- Returns the position of the specified node within the shader graph.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_get_valid_node_id:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_valid_node_id**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`\ ) |const| :ref:`🔗<class_VisualShader_method_get_valid_node_id>`
- Returns next valid node ID that can be added to the shader graph.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_has_varying:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **has_varying**\ (\ name\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_VisualShader_method_has_varying>`
- Returns ``true`` if the shader has a varying with the given ``name``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_is_node_connection:
- .. rst-class:: classref-method
- :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>`
- Returns ``true`` if the specified node and port connection exist.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_remove_node:
- .. rst-class:: classref-method
- |void| **remove_node**\ (\ type\: :ref:`Type<enum_VisualShader_Type>`, id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_VisualShader_method_remove_node>`
- Removes the specified node from the shader.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_remove_varying:
- .. rst-class:: classref-method
- |void| **remove_varying**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_VisualShader_method_remove_varying>`
- Removes a varying value node with the given ``name``. Prints an error if a node with this name is not found.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_replace_node:
- .. rst-class:: classref-method
- |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>`
- Replaces the specified node with a node of new class type.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_set_mode:
- .. rst-class:: classref-method
- |void| **set_mode**\ (\ mode\: :ref:`Mode<enum_Shader_Mode>`\ ) :ref:`🔗<class_VisualShader_method_set_mode>`
- Sets the mode of this shader.
- .. rst-class:: classref-item-separator
- ----
- .. _class_VisualShader_method_set_node_position:
- .. rst-class:: classref-method
- |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>`
- Sets the position of the specified node.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|