VisualShaderNodeCustom

Virtual class to define custom VisualShaderNodes for use in the Visual Shader Editor.

By inheriting this class you can create a custom VisualShader script addon which will be automatically added to the Visual Shader Editor. The VisualShaderNode's behavior is defined by overriding the provided virtual methods. In order for the node to be registered as an editor addon, you must use the tool keyword and provide a class_name for your custom script. For example:

More...

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_getCategory
String _getCategory()

Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. The path may look like "MyGame/MyFunctions/Noise". Defining this method is optional. If not overridden, the node will be filed under the "Custom" category.

_getCode
String _getCode(Array input_vars, Array output_vars, long mode, long type)

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$(D 0) + " = " + input_vars$(D 0) + ";". You can customize the generated code based on the shader mode (see Shader.mode) and/or type (see VisualShader.type). Defining this method is required.

_getDescription
String _getDescription()

Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is optional.

_getGlobalCode
String _getGlobalCode(long mode)

Override this method to add shader code on top of the global shader, to define your own standard library of reusable methods, varyings, constants, uniforms, etc. The shader code should be returned as a string, which can have multiple lines (the """ multiline string construct can be used for convenience). Be careful with this functionality as it can cause name conflicts with other custom nodes, so be sure to give the defined entities unique names. You can customize the generated code based on the shader mode (see Shader.mode). Defining this method is optional.

_getInputPortCount
long _getInputPortCount()

Override this method to define the amount of input ports of the associated custom node. Defining this method is required. If not overridden, the node has no input ports.

_getInputPortName
String _getInputPortName(long port)

Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the input_vars array in _getCode. Defining this method is optional, but recommended. If not overridden, input ports are named as "in" + str(port).

_getInputPortType
long _getInputPortType(long port)

Override this method to define the returned type of each input port of the associated custom node (see VisualShaderNode.porttype for possible types). Defining this method is optional, but recommended. If not overridden, input ports will return the constant VisualShaderNode.PORT_TYPE_SCALAR type.

_getName
String _getName()

Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. Defining this method is optional, but recommended. If not overridden, the node will be named as "Unnamed".

_getOutputPortCount
long _getOutputPortCount()

Override this method to define the amount of output ports of the associated custom node. Defining this method is required. If not overridden, the node has no output ports.

_getOutputPortName
String _getOutputPortName(long port)

Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the output_vars array in _getCode. Defining this method is optional, but recommended. If not overridden, output ports are named as "out" + str(port).

_getOutputPortType
long _getOutputPortType(long port)

Override this method to define the returned type of each output port of the associated custom node (see VisualShaderNode.porttype for possible types). Defining this method is optional, but recommended. If not overridden, output ports will return the constant VisualShaderNode.PORT_TYPE_SCALAR type.

_getReturnIconType
long _getReturnIconType()

Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is optional. If not overridden, no return icon is shown.

_getSubcategory
String _getSubcategory()

Override this method to define the subcategory of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is optional. If not overridden, the node will be filed under the root of the main category (see _getCategory).

_isInitialized
bool _isInitialized()
_setInitialized
void _setInitialized(bool enabled)
_setInputPortDefaultValue
void _setInputPortDefaultValue(long port, VariantArg1 value)
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(VisualShaderNodeCustom other)
opEquals
bool opEquals(typeof(null) n)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

initialized
bool initialized [@property getter]
bool initialized [@property setter]

Static functions

_new
VisualShaderNodeCustom _new()

Construct a new instance of VisualShaderNodeCustom. Note: use memnew!VisualShaderNodeCustom instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Detailed Description

tool extends VisualShaderNodeCustom class_name VisualShaderNodeNoise

Meta