VisualShader

package
v0.0.0-...-f3deeb4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package VisualShader provides methods for working with VisualShader object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsVisualShader() Instance
}

type Instance

type Instance [1]gdclass.VisualShader

This class provides a graph-like visual editor for creating a [Shader]. Although [VisualShader]s do not require coding, they share the same logic with script shaders. They use [VisualShaderNode]s 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.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddNode

func (self Instance) AddNode(atype gdclass.VisualShaderType, node [1]gdclass.VisualShaderNode, position Vector2.XY, id int)

Adds the specified [param node] to the shader.

func (Instance) AddVarying

Adds a new varying value node to the shader.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsShader

func (self Instance) AsShader() Shader.Instance

func (Instance) AsVisualShader

func (self Instance) AsVisualShader() Instance

func (Instance) AttachNodeToFrame

func (self Instance) AttachNodeToFrame(atype gdclass.VisualShaderType, id int, frame_ int)

Attaches the given node to the given frame.

func (Instance) CanConnectNodes

func (self Instance) CanConnectNodes(atype gdclass.VisualShaderType, from_node int, from_port int, to_node int, to_port int) bool

Returns [code]true[/code] if the specified nodes and ports can be connected together.

func (Instance) ConnectNodes

func (self Instance) ConnectNodes(atype gdclass.VisualShaderType, from_node int, from_port int, to_node int, to_port int) error

Connects the specified nodes and ports.

func (Instance) ConnectNodesForced

func (self Instance) ConnectNodesForced(atype gdclass.VisualShaderType, from_node int, from_port int, to_node int, to_port int)

Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly.

func (Instance) DetachNodeFromFrame

func (self Instance) DetachNodeFromFrame(atype gdclass.VisualShaderType, id int)

Detaches the given node from the frame it is attached to.

func (Instance) DisconnectNodes

func (self Instance) DisconnectNodes(atype gdclass.VisualShaderType, from_node int, from_port int, to_node int, to_port int)

Connects the specified nodes and ports.

func (Instance) GetNode

func (self Instance) GetNode(atype gdclass.VisualShaderType, id int) [1]gdclass.VisualShaderNode

Returns the shader node instance with specified [param type] and [param id].

func (Instance) GetNodeConnections

func (self Instance) GetNodeConnections(atype gdclass.VisualShaderType) []map[string]interface{}

Returns the list of connected nodes with the specified type.

func (Instance) GetNodeList

func (self Instance) GetNodeList(atype gdclass.VisualShaderType) []int32

Returns the list of all nodes in the shader with the specified type.

func (Instance) GetNodePosition

func (self Instance) GetNodePosition(atype gdclass.VisualShaderType, id int) Vector2.XY

Returns the position of the specified node within the shader graph.

func (Instance) GetValidNodeId

func (self Instance) GetValidNodeId(atype gdclass.VisualShaderType) int

Returns next valid node ID that can be added to the shader graph.

func (Instance) GraphOffset

func (self Instance) GraphOffset() Vector2.XY

func (Instance) HasVarying

func (self Instance) HasVarying(name string) bool

Returns [code]true[/code] if the shader has a varying with the given [param name].

func (Instance) IsNodeConnection

func (self Instance) IsNodeConnection(atype gdclass.VisualShaderType, from_node int, from_port int, to_node int, to_port int) bool

Returns [code]true[/code] if the specified node and port connection exist.

func (Instance) RemoveNode

func (self Instance) RemoveNode(atype gdclass.VisualShaderType, id int)

Removes the specified node from the shader.

func (Instance) RemoveVarying

func (self Instance) RemoveVarying(name string)

Removes a varying value node with the given [param name]. Prints an error if a node with this name is not found.

func (Instance) ReplaceNode

func (self Instance) ReplaceNode(atype gdclass.VisualShaderType, id int, new_class string)

Replaces the specified node with a node of new class type.

func (Instance) SetGraphOffset

func (self Instance) SetGraphOffset(value Vector2.XY)

func (Instance) SetMode

func (self Instance) SetMode(mode gdclass.ShaderMode)

Sets the mode of this shader.

func (Instance) SetNodePosition

func (self Instance) SetNodePosition(atype gdclass.VisualShaderType, id int, position Vector2.XY)

Sets the position of the specified node.

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Type

type Type = gdclass.VisualShaderType //gd:VisualShader.Type
const (
	/*A vertex shader, operating on vertices.*/
	TypeVertex Type = 0
	/*A fragment shader, operating on fragments (pixels).*/
	TypeFragment Type = 1
	/*A shader for light calculations.*/
	TypeLight Type = 2
	/*A function for the "start" stage of particle shader.*/
	TypeStart Type = 3
	/*A function for the "process" stage of particle shader.*/
	TypeProcess Type = 4
	/*A function for the "collide" stage (particle collision handler) of particle shader.*/
	TypeCollide Type = 5
	/*A function for the "start" stage of particle shader, with customized output.*/
	TypeStartCustom Type = 6
	/*A function for the "process" stage of particle shader, with customized output.*/
	TypeProcessCustom Type = 7
	/*A shader for 3D environment's sky.*/
	TypeSky Type = 8
	/*A compute shader that runs for each froxel of the volumetric fog map.*/
	TypeFog Type = 9
	/*Represents the size of the [enum Type] enum.*/
	TypeMax Type = 10
)

type VaryingMode

type VaryingMode = gdclass.VisualShaderVaryingMode //gd:VisualShader.VaryingMode
const (
	/*Varying is passed from [code]Vertex[/code] function to [code]Fragment[/code] and [code]Light[/code] functions.*/
	VaryingModeVertexToFragLight VaryingMode = 0
	/*Varying is passed from [code]Fragment[/code] function to [code]Light[/code] function.*/
	VaryingModeFragToLight VaryingMode = 1
	/*Represents the size of the [enum VaryingMode] enum.*/
	VaryingModeMax VaryingMode = 2
)

type VaryingType

type VaryingType = gdclass.VisualShaderVaryingType //gd:VisualShader.VaryingType
const (
	/*Varying is of type [float].*/
	VaryingTypeFloat VaryingType = 0
	/*Varying is of type [int].*/
	VaryingTypeInt VaryingType = 1
	/*Varying is of type unsigned [int].*/
	VaryingTypeUint VaryingType = 2
	/*Varying is of type [Vector2].*/
	VaryingTypeVector2d VaryingType = 3
	/*Varying is of type [Vector3].*/
	VaryingTypeVector3d VaryingType = 4
	/*Varying is of type [Vector4].*/
	VaryingTypeVector4d VaryingType = 5
	/*Varying is of type [bool].*/
	VaryingTypeBoolean VaryingType = 6
	/*Varying is of type [Transform3D].*/
	VaryingTypeTransform VaryingType = 7
	/*Represents the size of the [enum VaryingType] enum.*/
	VaryingTypeMax VaryingType = 8
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL