Click or drag to resize

VisualShaderNodeCustom_GetCode Method

Override this method to define the actual shader code of the associated custom node. The shader code should be returned as a string, which can have multiple lines (the """ multiline string construct can be used for convenience).

The input_vars and output_vars arrays contain the string names of the various input and output variables, as defined by _get_input_* and _get_output_* virtual methods in this class.

The output ports can be assigned values in the shader code. For example, return output_vars[0] + " = " + input_vars[0] + ";".

You can customize the generated code based on the shader mode (see ShaderMode) and/or type (see VisualShaderType).

Defining this method is required.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public virtual string _GetCode(
	Array inputVars,
	Array outputVars,
	int mode,
	int type
)

Parameters

inputVars
Type: Godot.CollectionsArray

[Missing <param name="inputVars"/> documentation for "M:Godot.VisualShaderNodeCustom._GetCode(Godot.Collections.Array,Godot.Collections.Array,System.Int32,System.Int32)"]

outputVars
Type: Godot.CollectionsArray

[Missing <param name="outputVars"/> documentation for "M:Godot.VisualShaderNodeCustom._GetCode(Godot.Collections.Array,Godot.Collections.Array,System.Int32,System.Int32)"]

mode
Type: SystemInt32

[Missing <param name="mode"/> documentation for "M:Godot.VisualShaderNodeCustom._GetCode(Godot.Collections.Array,Godot.Collections.Array,System.Int32,System.Int32)"]

type
Type: SystemInt32

[Missing <param name="type"/> documentation for "M:Godot.VisualShaderNodeCustom._GetCode(Godot.Collections.Array,Godot.Collections.Array,System.Int32,System.Int32)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Godot.VisualShaderNodeCustom._GetCode(Godot.Collections.Array,Godot.Collections.Array,System.Int32,System.Int32)"]

See Also