Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

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

Vector2

graph_offset

Vector2(0, 0)

Methods

void

add_node ( Type type, VisualShaderNode node, Vector2 position, int id )

void

add_varying ( String name, VaryingMode mode, VaryingType type )

bool

can_connect_nodes ( Type type, int from_node, int from_port, int to_node, int to_port ) const

Error

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 )

VisualShaderNode

get_node ( Type type, int id ) const

Dictionary[]

get_node_connections ( Type type ) const

PackedInt32Array