summaryrefslogtreecommitdiff
path: root/doc/classes/VisualShader.xml
blob: 3c5a6f3a338c55acf2e5cda655a972f2171f75a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShader" inherits="Shader" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
	<brief_description>
		A custom shader program with a visual editor.
	</brief_description>
	<description>
		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.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="add_node">
			<return type="void" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="node" type="VisualShaderNode" />
			<argument index="2" name="position" type="Vector2" />
			<argument index="3" name="id" type="int" />
			<description>
				Adds the specified node to the shader.
			</description>
		</method>
		<method name="can_connect_nodes" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="from_node" type="int" />
			<argument index="2" name="from_port" type="int" />
			<argument index="3" name="to_node" type="int" />
			<argument index="4" name="to_port" type="int" />
			<description>
				Returns [code]true[/code] if the specified nodes and ports can be connected together.
			</description>
		</method>
		<method name="connect_nodes">
			<return type="int" enum="Error" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="from_node" type="int" />
			<argument index="2" name="from_port" type="int" />
			<argument index="3" name="to_node" type="int" />
			<argument index="4" name="to_port" type="int" />
			<description>
				Connects the specified nodes and ports.
			</description>
		</method>
		<method name="connect_nodes_forced">
			<return type="void" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="from_node" type="int" />
			<argument index="2" name="from_port" type="int" />
			<argument index="3" name="to_node" type="int" />
			<argument index="4" name="to_port" type="int" />
			<description>
				Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly.
			</description>
		</method>
		<method name="disconnect_nodes">
			<return type="void" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="from_node" type="int" />
			<argument index="2" name="from_port" type="int" />
			<argument index="3" name="to_node" type="int" />
			<argument index="4" name="to_port" type="int" />
			<description>
				Connects the specified nodes and ports.
			</description>
		</method>
		<method name="get_node" qualifiers="const">
			<return type="VisualShaderNode" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="id" type="int" />
			<description>
				Returns the shader node instance with specified [code]type[/code] and [code]id[/code].
			</description>
		</method>
		<method name="get_node_connections" qualifiers="const">
			<return type="Array" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<description>
				Returns the list of connected nodes with the specified type.
			</description>
		</method>
		<method name="get_node_list" qualifiers="const">
			<return type="PackedInt32Array" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<description>
				Returns the list of all nodes in the shader with the specified type.
			</description>
		</method>
		<method name="get_node_position" qualifiers="const">
			<return type="Vector2" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="id" type="int" />
			<description>
				Returns the position of the specified node within the shader graph.
			</description>
		</method>
		<method name="get_valid_node_id" qualifiers="const">
			<return type="int" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<description>
			</description>
		</method>
		<method name="is_node_connection" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="from_node" type="int" />
			<argument index="2" name="from_port" type="int" />
			<argument index="3" name="to_node" type="int" />
			<argument index="4" name="to_port" type="int" />
			<description>
				Returns [code]true[/code] if the specified node and port connection exist.
			</description>
		</method>
		<method name="remove_node">
			<return type="void" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="id" type="int" />
			<description>
				Removes the specified node from the shader.
			</description>
		</method>
		<method name="replace_node">
			<return type="void" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="id" type="int" />
			<argument index="2" name="new_class" type="StringName" />
			<description>
				Replaces the specified node with a node of new class type.
			</description>
		</method>
		<method name="set_mode">
			<return type="void" />
			<argument index="0" name="mode" type="int" enum="Shader.Mode" />
			<description>
				Sets the mode of this shader.
			</description>
		</method>
		<method name="set_node_position">
			<return type="void" />
			<argument index="0" name="type" type="int" enum="VisualShader.Type" />
			<argument index="1" name="id" type="int" />
			<argument index="2" name="position" type="Vector2" />
			<description>
				Sets the position of the specified node.
			</description>
		</method>
	</methods>
	<members>
		<member name="engine_version" type="Dictionary" setter="set_engine_version" getter="get_engine_version" default="{}">
			The Godot version this [VisualShader] was designed for, in the form of a [Dictionary] with [code]major[/code] and [code]minor[/code] keys with integer values. Example: [code]{"major": 4, "minor": 0}[/code]
			This is used by the editor to convert visual shaders from older Godot versions.
		</member>
		<member name="graph_offset" type="Vector2" setter="set_graph_offset" getter="get_graph_offset" default="Vector2(0, 0)">
			The offset vector of the whole graph.
		</member>
	</members>
	<constants>
		<constant name="TYPE_VERTEX" value="0" enum="Type">
			A vertex shader, operating on vertices.
		</constant>
		<constant name="TYPE_FRAGMENT" value="1" enum="Type">
			A fragment shader, operating on fragments (pixels).
		</constant>
		<constant name="TYPE_LIGHT" value="2" enum="Type">
			A shader for light calculations.
		</constant>
		<constant name="TYPE_START" value="3" enum="Type">
		</constant>
		<constant name="TYPE_PROCESS" value="4" enum="Type">
		</constant>
		<constant name="TYPE_COLLIDE" value="5" enum="Type">
		</constant>
		<constant name="TYPE_START_CUSTOM" value="6" enum="Type">
		</constant>
		<constant name="TYPE_PROCESS_CUSTOM" value="7" enum="Type">
		</constant>
		<constant name="TYPE_SKY" value="8" enum="Type">
		</constant>
		<constant name="TYPE_FOG" value="9" enum="Type">
			A compute shader that runs for each froxel of the volumetric fog map.
		</constant>
		<constant name="TYPE_MAX" value="10" enum="Type">
			Represents the size of the [enum Type] enum.
		</constant>
		<constant name="NODE_ID_INVALID" value="-1">
		</constant>
		<constant name="NODE_ID_OUTPUT" value="0">
		</constant>
	</constants>
</class>