Inherits: Shader < Resource < RefCounted < Object
A custom shader program with a visual editor.
This class provides a graph-like visual editor for creating a Shader. Although VisualShaders do not require coding, they share the same logic with script shaders. They use VisualShaderNodes 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.
|
void | add_node ( Type type, VisualShaderNode node, Vector2 position, int id ) |
void | add_varying ( String name, VaryingMode mode, VaryingType type ) |
can_connect_nodes ( Type type, int from_node, int from_port, int to_node, int to_port ) const | |
connect_nodes ( Type type, int from_node, int from_port, int to_node, int to_port ) | |
void | connect_nodes_forced ( Type type, int from_node, int from_port, int to_node, int to_port ) |
void | disconnect_nodes ( Type type, int from_node, int from_port, int to_node, int to_port ) |
get_node_connections ( Type type ) const | |
get_node_list ( Type type ) const | |
get_node_position ( Type type, int id ) const | |
get_valid_node_id ( Type type ) const | |
has_varying ( String name ) const | |
is_node_connection ( Type type, int from_node, int from_port, int to_node, int to_port ) const | |
void | remove_node ( Type type, int id ) |
void | remove_varying ( String name ) |
void | replace_node ( Type type, int id, StringName new_class ) |
void | |
void | set_node_position ( Type type, int id, Vector2 position ) |
0
A vertex shader, operating on vertices.
1
A fragment shader, operating on fragments (pixels).
2
A shader for light calculations.
3
A function for the "start" stage of particle shader.
4
A function for the "process" stage of particle shader.
5
A function for the "collide" stage (particle collision handler) of particle shader.
6
A function for the "start" stage of particle shader, with customized output.
7
A function for the "process" stage of particle shader, with customized output.
8
A shader for 3D environment's sky.
9
A compute shader that runs for each froxel of the volumetric fog map.
10
Represents the size of the Type enum.
0
Varying is passed from Vertex function to Fragment and Light functions.
1
Varying is passed from Fragment function to Light function.
2
Represents the size of the VaryingMode enum.
0
Varying is of type float.
1
Varying is of type int.
2
Varying is of type unsigned int.
3
Varying is of type Vector2.
4
Varying is of type Vector3.
5
Varying is of type Vector4.
6
Varying is of type bool.
7
Varying is of type Transform3D.
8
Represents the size of the VaryingType enum.
-1
Denotes invalid VisualShader node.
0
Denotes output node of VisualShader.
Vector2(0, 0)
The offset vector of the whole graph.
Adds the specified node to the shader.
Adds a new varying value node to the shader.
Returns true if the specified nodes and ports can be connected together.
Connects the specified nodes and ports.
Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly.
Connects the specified nodes and ports.
Returns the shader node instance with specified type and id.
Returns the list of connected nodes with the specified type.
Returns the list of all nodes in the shader with the specified type.
Returns the position of the specified node within the shader graph.
Returns next valid node ID that can be added to the shader graph.
Returns true if the shader has a varying with the given name.
Returns true if the specified node and port connection exist.
Removes the specified node from the shader.
Removes a varying value node with the given name. Prints an error if a node with this name is not found.
Replaces the specified node with a node of new class type.
Sets the mode of this shader.
Sets the position of the specified node.
© 2014–present Juan Linietsky, Ariel Manzur and the Godot community
Licensed under the Creative Commons Attribution Unported License v3.0.
https://docs.godotengine.org/en/4.2/classes/class_visualshader.html