| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | <?xml version="1.0" encoding="UTF-8" ?> | 
					
						
							| 
									
										
										
										
											2020-01-31 17:03:48 -08:00
										 |  |  | <class name="VisualShader" inherits="Shader" version="4.0"> | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 	<brief_description> | 
					
						
							| 
									
										
										
										
											2019-10-11 12:06:57 -03:00
										 |  |  | 		A custom shader program with a visual editor. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 	</brief_description> | 
					
						
							|  |  |  | 	<description> | 
					
						
							| 
									
										
										
										
											2019-10-11 12:06:57 -03:00
										 |  |  | 		This class allows you to define a custom shader program that can be used for various materials to render objects. | 
					
						
							|  |  |  | 		The visual shader editor creates the shader. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 	</description> | 
					
						
							|  |  |  | 	<tutorials> | 
					
						
							|  |  |  | 	</tutorials> | 
					
						
							|  |  |  | 	<methods> | 
					
						
							|  |  |  | 		<method name="add_node"> | 
					
						
							|  |  |  | 			<return type="void"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="node" type="VisualShaderNode"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="2" name="position" type="Vector2"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="3" name="id" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Adds the specified node to the shader. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="can_connect_nodes" qualifiers="const"> | 
					
						
							|  |  |  | 			<return type="bool"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="from_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="2" name="from_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="3" name="to_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="4" name="to_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Returns [code]true[/code] if the specified nodes and ports can be connected together. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="connect_nodes"> | 
					
						
							|  |  |  | 			<return type="int" enum="Error"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="from_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="2" name="from_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="3" name="to_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="4" name="to_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Connects the specified nodes and ports. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							| 
									
										
										
										
											2019-05-28 18:08:13 +02:00
										 |  |  | 		<method name="connect_nodes_forced"> | 
					
						
							|  |  |  | 			<return type="void"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="from_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="2" name="from_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="3" name="to_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="4" name="to_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly. | 
					
						
							| 
									
										
										
										
											2019-05-28 18:08:13 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 		<method name="disconnect_nodes"> | 
					
						
							|  |  |  | 			<return type="void"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="from_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="2" name="from_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="3" name="to_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="4" name="to_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Connects the specified nodes and ports. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="get_node" qualifiers="const"> | 
					
						
							|  |  |  | 			<return type="VisualShaderNode"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="id" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Returns the shader node instance with specified [code]type[/code] and [code]id[/code]. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="get_node_connections" qualifiers="const"> | 
					
						
							|  |  |  | 			<return type="Array"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Returns the list of connected nodes with the specified type. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="get_node_list" qualifiers="const"> | 
					
						
							| 
									
										
										
										
											2020-02-25 18:10:58 +01:00
										 |  |  | 			<return type="PackedInt32Array"> | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Returns the list of all nodes in the shader with the specified type. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="get_node_position" qualifiers="const"> | 
					
						
							|  |  |  | 			<return type="Vector2"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="id" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Returns the position of the specified node within the shader graph. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="get_valid_node_id" qualifiers="const"> | 
					
						
							|  |  |  | 			<return type="int"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							|  |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="is_node_connection" qualifiers="const"> | 
					
						
							|  |  |  | 			<return type="bool"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="from_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="2" name="from_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="3" name="to_node" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="4" name="to_port" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Returns [code]true[/code] if the specified node and port connection exist. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="remove_node"> | 
					
						
							|  |  |  | 			<return type="void"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="id" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Removes the specified node from the shader. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							| 
									
										
										
										
											2020-12-30 11:45:31 +03:00
										 |  |  | 		<method name="replace_node"> | 
					
						
							|  |  |  | 			<return type="void"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="id" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="2" name="new_class" type="StringName"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							|  |  |  | 				Replaces the specified node with a node of new class type. | 
					
						
							|  |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 		<method name="set_mode"> | 
					
						
							|  |  |  | 			<return type="void"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="mode" type="int" enum="Shader.Mode"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Sets the mode of this shader. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 		<method name="set_node_position"> | 
					
						
							|  |  |  | 			<return type="void"> | 
					
						
							|  |  |  | 			</return> | 
					
						
							|  |  |  | 			<argument index="0" name="type" type="int" enum="VisualShader.Type"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="1" name="id" type="int"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<argument index="2" name="position" type="Vector2"> | 
					
						
							|  |  |  | 			</argument> | 
					
						
							|  |  |  | 			<description> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 				Sets the position of the specified node. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 			</description> | 
					
						
							|  |  |  | 		</method> | 
					
						
							|  |  |  | 	</methods> | 
					
						
							|  |  |  | 	<members> | 
					
						
							| 
									
										
										
										
											2019-06-29 12:38:01 +02:00
										 |  |  | 		<member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2( 0, 0 )"> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 			The offset vector of the whole graph. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 		</member> | 
					
						
							| 
									
										
										
										
											2020-02-29 14:22:57 +01:00
										 |  |  | 		<member name="version" type="String" setter="set_version" getter="get_version" default=""""> | 
					
						
							|  |  |  | 		</member> | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 	</members> | 
					
						
							|  |  |  | 	<constants> | 
					
						
							|  |  |  | 		<constant name="TYPE_VERTEX" value="0" enum="Type"> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 			A vertex shader, operating on vertices. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 		</constant> | 
					
						
							|  |  |  | 		<constant name="TYPE_FRAGMENT" value="1" enum="Type"> | 
					
						
							| 
									
										
										
										
											2020-03-03 19:21:21 +01:00
										 |  |  | 			A fragment shader, operating on fragments (pixels). | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 		</constant> | 
					
						
							|  |  |  | 		<constant name="TYPE_LIGHT" value="2" enum="Type"> | 
					
						
							| 
									
										
										
										
											2020-03-13 17:16:44 +01:00
										 |  |  | 			A shader for light calculations. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 		</constant> | 
					
						
							| 
									
										
										
										
											2020-09-11 12:22:10 +02:00
										 |  |  | 		<constant name="TYPE_EMIT" value="3" enum="Type"> | 
					
						
							| 
									
										
										
										
											2020-09-04 10:43:11 +02:00
										 |  |  | 		</constant> | 
					
						
							| 
									
										
										
										
											2020-09-11 12:22:10 +02:00
										 |  |  | 		<constant name="TYPE_PROCESS" value="4" enum="Type"> | 
					
						
							|  |  |  | 		</constant> | 
					
						
							|  |  |  | 		<constant name="TYPE_END" value="5" enum="Type"> | 
					
						
							|  |  |  | 		</constant> | 
					
						
							| 
									
										
										
										
											2021-04-19 12:26:37 +02:00
										 |  |  | 		<constant name="TYPE_SKY" value="6" enum="Type"> | 
					
						
							|  |  |  | 		</constant> | 
					
						
							|  |  |  | 		<constant name="TYPE_MAX" value="7" enum="Type"> | 
					
						
							| 
									
										
										
										
											2019-06-27 11:10:53 +02:00
										 |  |  | 			Represents the size of the [enum Type] enum. | 
					
						
							| 
									
										
										
										
											2018-07-26 11:56:21 +02:00
										 |  |  | 		</constant> | 
					
						
							|  |  |  | 		<constant name="NODE_ID_INVALID" value="-1"> | 
					
						
							|  |  |  | 		</constant> | 
					
						
							|  |  |  | 		<constant name="NODE_ID_OUTPUT" value="0"> | 
					
						
							|  |  |  | 		</constant> | 
					
						
							|  |  |  | 	</constants> | 
					
						
							|  |  |  | </class> |