Index · Object → RefCounted → Resource → VisualShaderNode

VisualShaderNode

Base class for VisualShader nodes. Not related to scene nodes.

Inherited by (62): VisualShaderNodeBillboardVisualShaderNodeClampVisualShaderNodeColorFuncVisualShaderNodeColorOpVisualShaderNodeCompareVisualShaderNodeConstantVisualShaderNodeCubemapVisualShaderNodeCustomVisualShaderNodeDerivativeFuncVisualShaderNodeDeterminantVisualShaderNodeDistanceFadeVisualShaderNodeDotProductVisualShaderNodeFloatFuncVisualShaderNodeFloatOpVisualShaderNodeFresnelVisualShaderNodeIfVisualShaderNodeInputVisualShaderNodeIntFuncVisualShaderNodeIntOpVisualShaderNodeIs (+42 more)
Class Description

Visual shader graphs consist of various nodes. Each node in the graph is a separate object and they are represented as a rectangular boxes with title and a set of properties. Each node also has connection ports that allow to connect it to another nodes and control the flow of the shader.

Properties

var linked_parent_graph_frame: int = -1

Represents the index of the frame this node is linked to. If set to -1 the node is not linked to any frame.

var output_port_for_preview: int = -1

Sets the output port index which will be showed for preview. If set to -1 no port will be open for preview.

Inherited from Resource (4)

Methods

func clear_default_input_values() -> void

Clears the default input ports value.

func get_default_input_port(type: VisualShaderNode.PortType) -> int

Returns the input port which should be connected by default when this node is created as a result of dragging a connection from an existing node to the empty space on the graph.

func get_default_input_values() -> Array

Returns an Array containing default values for all of the input ports of the node in the form [index0, value0, index1, value1, ...].

func get_input_port_default_value(port: int) -> Variant

Returns the default value of the input port.

func remove_input_port_default_value(port: int) -> void

Removes the default value of the input port.

func set_default_input_values(values: Array) -> void

Sets the default input ports values using an Array of the form [index0, value0, index1, value1, ...]. For example: [0, Vector3(0, 0, 0), 1, Vector3(0, 0, 0)].

func set_input_port_default_value(port: int, value: Variant, prev_value: Variant = null) -> void

Sets the default value for the selected input port.

Inherited from Resource (18)
func _get_rid() -> RID
func _reset_state() -> void
func _set_path_cache(path: String) -> void
func _setup_local_to_scene() -> void
func copy_from_resource(resource: Resource) -> Error
func duplicate(deep: bool = false) -> Resource
func duplicate_deep(deep_subresources_mode: Resource.DeepDuplicateMode = 1) -> Resource
func emit_changed() -> void
func get_rid() -> RID
func is_built_in() -> bool
func reset_state() -> void
func set_id_for_path(path: String, id: String) -> void
func set_path_cache(path: String) -> void
func setup_local_to_scene() -> void
func take_over_path(path: String) -> void
Inherited from RefCounted (4)
func init_ref() -> bool
func reference() -> bool
func unreference() -> bool
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

Inherited from Resource (2)
signal changed()
Inherited from Object (2)

Enums & Constants

enum PortType
PORT_TYPE_SCALAR = 0

Floating-point scalar. Translated to [code skip-lint]float[/code] type in shader code.

PORT_TYPE_SCALAR_INT = 1

Integer scalar. Translated to [code skip-lint]int[/code] type in shader code.

PORT_TYPE_SCALAR_UINT = 2

Unsigned integer scalar. Translated to [code skip-lint]uint[/code] type in shader code.

PORT_TYPE_VECTOR_2D = 3

2D vector of floating-point values. Translated to [code skip-lint]vec2[/code] type in shader code.

PORT_TYPE_VECTOR_3D = 4

3D vector of floating-point values. Translated to [code skip-lint]vec3[/code] type in shader code.

PORT_TYPE_VECTOR_4D = 5

4D vector of floating-point values. Translated to [code skip-lint]vec4[/code] type in shader code.

PORT_TYPE_BOOLEAN = 6

Boolean type. Translated to [code skip-lint]bool[/code] type in shader code.

PORT_TYPE_TRANSFORM = 7

Transform type. Translated to [code skip-lint]mat4[/code] type in shader code.

PORT_TYPE_SAMPLER = 8

Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes.

PORT_TYPE_MAX = 9

Represents the size of the PortType enum.