2018-07-26 09:56:21 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 08:08:05 +00:00
<class name= "VisualShaderNode" inherits= "Resource" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2018-07-26 09:56:21 +00:00
<brief_description >
2023-06-24 11:19:58 +00:00
Base class for [VisualShader] nodes. Not related to scene nodes.
2018-07-26 09:56:21 +00:00
</brief_description>
<description >
2023-06-24 11:19:58 +00:00
Visual shader graphs consist of various nodes. Each node in the graph is a separate object and they are represented as a rectangular boxes with title and a set of properties. Each node also has connection ports that allow to connect it to another nodes and control the flow of the shader.
2018-07-26 09:56:21 +00:00
</description>
<tutorials >
2023-06-24 11:19:58 +00:00
<link title= "Using VisualShaders" > $DOCS_URL/tutorials/shaders/visual_shaders.html</link>
2018-07-26 09:56:21 +00:00
</tutorials>
<methods >
2021-06-05 12:53:53 +00:00
<method name= "clear_default_input_values" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2021-06-05 12:53:53 +00:00
<description >
Clears the default input ports value.
</description>
</method>
2023-06-22 07:33:40 +00:00
<method name= "get_default_input_port" qualifiers= "const" >
<return type= "int" />
<param index= "0" name= "type" type= "int" enum= "VisualShaderNode.PortType" />
<description >
Returns the input port which should be connected by default when this node is created as a result of dragging a connection from an existing node to the empty space on the graph.
</description>
</method>
2020-01-23 10:14:14 +00:00
<method name= "get_default_input_values" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Array" />
2020-01-23 10:14:14 +00:00
<description >
2020-01-23 07:31:45 +00:00
Returns an [Array] containing default values for all of the input ports of the node in the form [code][index0, value0, index1, value1, ...][/code].
2020-01-23 10:14:14 +00:00
</description>
</method>
2018-07-26 09:56:21 +00:00
<method name= "get_input_port_default_value" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Variant" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "port" type= "int" />
2018-07-26 09:56:21 +00:00
<description >
2022-08-08 23:41:07 +00:00
Returns the default value of the input [param port].
2018-07-26 09:56:21 +00:00
</description>
</method>
2021-06-05 12:53:53 +00:00
<method name= "remove_input_port_default_value" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "port" type= "int" />
2021-06-05 12:53:53 +00:00
<description >
2022-08-08 23:41:07 +00:00
Removes the default value of the input [param port].
2021-06-05 12:53:53 +00:00
</description>
</method>
2020-01-23 10:14:14 +00:00
<method name= "set_default_input_values" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "values" type= "Array" />
2020-01-23 10:14:14 +00:00
<description >
2020-01-23 07:31:45 +00:00
Sets the default input ports values using an [Array] of the form [code][index0, value0, index1, value1, ...][/code]. For example: [code][0, Vector3(0, 0, 0), 1, Vector3(0, 0, 0)][/code].
2020-01-23 10:14:14 +00:00
</description>
</method>
2018-07-26 09:56:21 +00:00
<method name= "set_input_port_default_value" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "port" type= "int" />
<param index= "1" name= "value" type= "Variant" />
<param index= "2" name= "prev_value" type= "Variant" default= "null" />
2018-07-26 09:56:21 +00:00
<description >
2022-08-08 23:41:07 +00:00
Sets the default [param value] for the selected input [param port].
2018-07-26 09:56:21 +00:00
</description>
</method>
</methods>
<members >
2024-02-07 01:37:26 +00:00
<member name= "linked_parent_graph_frame" type= "int" setter= "set_frame" getter= "get_frame" default= "-1" >
Represents the index of the frame this node is linked to. If set to [code]-1[/code] the node is not linked to any frame.
</member>
2019-06-29 10:38:01 +00:00
<member name= "output_port_for_preview" type= "int" setter= "set_output_port_for_preview" getter= "get_output_port_for_preview" default= "-1" >
2020-01-23 07:31:45 +00:00
Sets the output port index which will be showed for preview. If set to [code]-1[/code] no port will be open for preview.
2018-07-26 09:56:21 +00:00
</member>
</members>
<constants >
2019-08-09 19:51:48 +00:00
<constant name= "PORT_TYPE_SCALAR" value= "0" enum= "PortType" >
2023-10-02 18:11:43 +00:00
Floating-point scalar. Translated to [code skip-lint]float[/code] type in shader code.
2019-08-09 19:51:48 +00:00
</constant>
2020-02-25 14:50:49 +00:00
<constant name= "PORT_TYPE_SCALAR_INT" value= "1" enum= "PortType" >
2023-10-02 18:11:43 +00:00
Integer scalar. Translated to [code skip-lint]int[/code] type in shader code.
2020-02-25 14:50:49 +00:00
</constant>
2022-12-27 17:49:11 +00:00
<constant name= "PORT_TYPE_SCALAR_UINT" value= "2" enum= "PortType" >
2023-10-02 18:11:43 +00:00
Unsigned integer scalar. Translated to [code skip-lint]uint[/code] type in shader code.
2022-12-27 17:49:11 +00:00
</constant>
<constant name= "PORT_TYPE_VECTOR_2D" value= "3" enum= "PortType" >
2023-10-02 18:11:43 +00:00
2D vector of floating-point values. Translated to [code skip-lint]vec2[/code] type in shader code.
2022-02-01 08:32:01 +00:00
</constant>
2022-12-27 17:49:11 +00:00
<constant name= "PORT_TYPE_VECTOR_3D" value= "4" enum= "PortType" >
2023-10-02 18:11:43 +00:00
3D vector of floating-point values. Translated to [code skip-lint]vec3[/code] type in shader code.
2019-08-09 19:51:48 +00:00
</constant>
2022-12-27 17:49:11 +00:00
<constant name= "PORT_TYPE_VECTOR_4D" value= "5" enum= "PortType" >
2023-10-02 18:11:43 +00:00
4D vector of floating-point values. Translated to [code skip-lint]vec4[/code] type in shader code.
2022-04-12 17:09:29 +00:00
</constant>
2022-12-27 17:49:11 +00:00
<constant name= "PORT_TYPE_BOOLEAN" value= "6" enum= "PortType" >
2023-10-02 18:11:43 +00:00
Boolean type. Translated to [code skip-lint]bool[/code] type in shader code.
2019-08-09 19:51:48 +00:00
</constant>
2022-12-27 17:49:11 +00:00
<constant name= "PORT_TYPE_TRANSFORM" value= "7" enum= "PortType" >
2023-10-02 18:11:43 +00:00
Transform type. Translated to [code skip-lint]mat4[/code] type in shader code.
2019-08-09 19:51:48 +00:00
</constant>
2022-12-27 17:49:11 +00:00
<constant name= "PORT_TYPE_SAMPLER" value= "8" enum= "PortType" >
2019-10-01 08:51:50 +00:00
Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes.
</constant>
2022-12-27 17:49:11 +00:00
<constant name= "PORT_TYPE_MAX" value= "9" enum= "PortType" >
2019-10-01 08:51:50 +00:00
Represents the size of the [enum PortType] enum.
2019-08-09 19:51:48 +00:00
</constant>
2018-07-26 09:56:21 +00:00
</constants>
</class>