VisualShader¶
Inherits: Shader < Resource < RefCounted < Object
A custom shader program with a visual editor.
Description¶
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.
Tutorials¶
Properties¶
|
Methods¶
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 ) |
Enumerations¶
enum Type:
Type TYPE_VERTEX = 0
A vertex shader, operating on vertices.
Type TYPE_FRAGMENT = 1
A fragment shader, operating on fragments (pixels).
Type TYPE_LIGHT = 2
A shader for light calculations.
Type TYPE_START = 3
A function for the "start" stage of particle shader.
Type TYPE_PROCESS = 4
A function for the "process" stage of particle shader.