VisualShaderNode

Inherits: Resource < Reference < Object

Inherited By: VisualShaderNodeBooleanConstant, VisualShaderNodeColorConstant, VisualShaderNodeColorFunc, VisualShaderNodeColorOp, VisualShaderNodeCompare, VisualShaderNodeCubeMap, VisualShaderNodeCustom, VisualShaderNodeDeterminant, VisualShaderNodeDotProduct, VisualShaderNodeFaceForward, VisualShaderNodeFresnel, VisualShaderNodeGroupBase, VisualShaderNodeIf, VisualShaderNodeInput, VisualShaderNodeIs, VisualShaderNodeOuterProduct, VisualShaderNodeOutput, VisualShaderNodeScalarClamp, VisualShaderNodeScalarConstant, VisualShaderNodeScalarDerivativeFunc, VisualShaderNodeScalarFunc, VisualShaderNodeScalarInterp, VisualShaderNodeScalarOp, VisualShaderNodeScalarSmoothStep, VisualShaderNodeSwitch, VisualShaderNodeTexture, VisualShaderNodeTransformCompose, VisualShaderNodeTransformConstant, VisualShaderNodeTransformDecompose, VisualShaderNodeTransformFunc, VisualShaderNodeTransformMult, VisualShaderNodeTransformVecMult, VisualShaderNodeUniform, VisualShaderNodeVec3Constant, VisualShaderNodeVectorClamp, VisualShaderNodeVectorCompose, VisualShaderNodeVectorDecompose, VisualShaderNodeVectorDerivativeFunc, VisualShaderNodeVectorDistance, VisualShaderNodeVectorFunc, VisualShaderNodeVectorInterp, VisualShaderNodeVectorLen, VisualShaderNodeVectorOp, VisualShaderNodeVectorRefract, VisualShaderNodeVectorScalarMix, VisualShaderNodeVectorScalarSmoothStep, VisualShaderNodeVectorScalarStep, VisualShaderNodeVectorSmoothStep

Tutorials

Signals

  • editor_refresh_request ( )

Emitted when the node requests an editor refresh. Currently called only in setter of VisualShaderNodeTexture.source, VisualShaderNodeTexture, and VisualShaderNodeCubeMap (and their derivatives).

Enumerations

enum PortType:

  • PORT_TYPE_SCALAR = 0 — Floating-point scalar. Translated to float type in shader code.
  • PORT_TYPE_VECTOR = 1 — 3D vector of floating-point values. Translated to vec3 type in shader code.
  • PORT_TYPE_BOOLEAN = 2 — Boolean type. Translated to bool type in shader code.
  • PORT_TYPE_TRANSFORM = 3 — Transform type. Translated to mat4 type in shader code.
  • PORT_TYPE_SAMPLER = 4 — 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 = 5 — Represents the size of the PortType enum.

Property Descriptions

  • int output_port_for_preview
Default-1
Setterset_output_port_for_preview(value)
Getterget_output_port_for_preview()

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

Method Descriptions

  • Array get_default_input_values ( ) const

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


  • Variant get_input_port_default_value ( int port ) const

Returns the default value of the input port.


  • void set_default_input_values ( Array values )

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)].


  • void set_input_port_default_value ( int port, Variant value )

Sets the default value for the selected input port.

doradoro's advice! Getters and Setters will be deprecated! Avoid their use!

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 2020-03-07 at 01:44:52. It's the English Stable version because it's what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.