VisualShader

Inherits: Shader < Resource < Reference < Object

A custom shader program with a visual editor.

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.

Properties

StringcodeO: "shader_type spatial;void vertex() {// Output:0}void fragment() {// Output:0}void light() {// Output:0}"
Vector2graph_offsetVector2( 0, 0 )

Methods

voidadd_node ( Type type, VisualShaderNode node, Vector2 position, int id )
boolcan_connect_nodes ( Type type, int from_node, int from_port, int to_node, int to_port ) const
Errorconnect_nodes ( Type type, int from_node, int from_port, int to_node, int to_port )
voidconnect_nodes_forced ( Type type, int from_node, int from_port, int to_node, int to_port )
voiddisconnect_nodes ( Type type, int from_node, int from_port, int to_node, int to_port )
VisualShaderNodeget_node ( Type type, int id ) const
Arrayget_node_connections ( Type type ) const
PoolIntArrayget_node_list ( Type type ) const
Vector2get_node_position ( Type type, int id ) const
intget_valid_node_id ( Type type ) const
boolis_node_connection ( Type type, int from_node, int from_port, int to_node, int to_port ) const
voidremove_node ( Type type, int id )
voidset_mode ( Mode mode )
voidset_node_position ( Type type, int id, Vector2 position )

Enumerations

enum Type:

  • TYPE_VERTEX = 0
  • TYPE_FRAGMENT = 1
  • TYPE_LIGHT = 2
  • TYPE_MAX = 3 — Represents the size of the Type enum.

Constants

  • NODE_ID_INVALID = -1
  • NODE_ID_OUTPUT = 0

Property Descriptions

DefaultVector2( 0, 0 )
Setterset_graph_offset(value)
Getterget_graph_offset()

Method Descriptions




  • 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 )


  • Array get_node_connections ( Type type ) const



  • int get_valid_node_id ( Type type ) const


  • void remove_node ( Type type, int id )

  • void set_mode ( Mode mode )

doradoro's advice! Getters and Setters will be deprecated! Avoid their use!

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 2020-03-07 at 01:43:24. It's the English Stable version because it's what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.