Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

VisualShaderNode

Inherits: Resource < RefCounted < Object

Inherited By: VisualShaderNodeBillboard, VisualShaderNodeClamp, VisualShaderNodeColorFunc, VisualShaderNodeColorOp, VisualShaderNodeCompare, VisualShaderNodeConstant, VisualShaderNodeCubemap, VisualShaderNodeCustom, VisualShaderNodeDerivativeFunc, VisualShaderNodeDeterminant, VisualShaderNodeDistanceFade, VisualShaderNodeDotProduct, VisualShaderNodeFloatFunc, VisualShaderNodeFloatOp, VisualShaderNodeFresnel, VisualShaderNodeIf, VisualShaderNodeInput, VisualShaderNodeIntFunc, VisualShaderNodeIntOp, VisualShaderNodeIs, VisualShaderNodeLinearSceneDepth, VisualShaderNodeMix, VisualShaderNodeMultiplyAdd, VisualShaderNodeOuterProduct, VisualShaderNodeOutput, VisualShaderNodeParameter, VisualShaderNodeParameterRef, VisualShaderNodeParticleAccelerator, VisualShaderNodeParticleConeVelocity, VisualShaderNodeParticleEmit, VisualShaderNodeParticleEmitter, VisualShaderNodeParticleMultiplyByAxisAngle, VisualShaderNodeParticleRandomness, VisualShaderNodeProximityFade, VisualShaderNodeRandomRange, VisualShaderNodeRemap, VisualShaderNodeResizableBase, VisualShaderNodeRotationByAxis, VisualShaderNodeSample3D, VisualShaderNodeScreenNormalWorldSpace, VisualShaderNodeScreenUVToSDF, VisualShaderNodeSDFRaymarch, VisualShaderNodeSDFToScreenUV, VisualShaderNodeSmoothStep, VisualShaderNodeStep, VisualShaderNodeSwitch, VisualShaderNodeTexture, VisualShaderNodeTextureSDF, VisualShaderNodeTextureSDFNormal, VisualShaderNodeTransformCompose, VisualShaderNodeTransformDecompose, VisualShaderNodeTransformFunc, VisualShaderNodeTransformOp, VisualShaderNodeTransformVecMult, VisualShaderNodeUIntFunc, VisualShaderNodeUIntOp, VisualShaderNodeUVFunc, VisualShaderNodeUVPolarCoord, VisualShaderNodeVarying, VisualShaderNodeVectorBase, VisualShaderNodeWorldPositionFromDepth

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

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.

Tutorials

Properties

int

output_port_for_preview

-1

Methods

void

clear_default_input_values()

int

get_default_input_port(type: PortType) const

Array

get_default_input_values() const

Variant

get_input_port_default_value(port: int) const

void

remove_input_port_default_value(port: int)

void

set_default_input_values(values: Array)

void

set_input_port_default_value(port: int, value: Variant, prev_value: Variant = null)


Enumerations

enum PortType:

PortType PORT_TYPE_SCALAR = 0

Floating-point scalar. Translated to float type in shader code.

PortType PORT_TYPE_SCALAR_INT = 1

Integer scalar. Translated to