Inheritance #

RefCounted

- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
Resource

- Animation
- AnimationLibrary
- AnimationNode (6)
- AnimationNodeStateMachinePlayback
- AnimationNodeStateMachineTransition
- AudioBusLayout
- AudioEffect (17)
- AudioStream (10)
- BitMap
- BoneMap
- ButtonGroup
- CameraAttributes (2)
- ColorPalette
- Compositor
- CompositorEffect
- CryptoKey
- Curve
- Curve2D
- Curve3D
- EditorNode3DGizmoPlugin
- EditorSettings
- Environment
- Font (3)
- GDExtension
- GLTFAccessor
- GLTFAnimation
- GLTFBufferView
- GLTFCamera
- GLTFDocument (1)
- GLTFDocumentExtension (1)
- GLTFLight
- GLTFMesh
- GLTFNode
- GLTFPhysicsBody
- GLTFPhysicsShape
- GLTFSkeleton
- GLTFSkin
- GLTFSpecGloss
- GLTFState (1)
- GLTFTexture
- GLTFTextureSampler
- Gradient
- Image
- ImporterMesh
- InputEvent (6)
- JSON
- LabelSettings
- LightmapGIData
- Material (9)
- Mesh (4)
- MeshLibrary
- MissingResource
- MultiMesh
- NavigationMesh
- NavigationMeshSourceGeometryData2D
- NavigationMeshSourceGeometryData3D
- NavigationPolygon
- Noise (1)
- Occluder3D (5)
- OccluderPolygon2D
- OggPacketSequence
- OpenXRAction
- OpenXRActionMap
- OpenXRActionSet
- OpenXRBindingModifier (2)
- OpenXRHapticBase (1)
- OpenXRIPBinding
- OpenXRInteractionProfile
- PackedDataContainer
- PackedScene
- PhysicsMaterial
- PolygonPathFinder
- RDShaderFile
- RDShaderSPIRV
- RichTextEffect
- SceneReplicationConfig
- Script (3)
- Shader (1)
- ShaderInclude
- Shape2D (8)
- Shape3D (9)
- Shortcut
- SkeletonModification2D (7)
- SkeletonModificationStack2D
- SkeletonProfile (1)
- Skin
- Sky
- SpriteFrames
- StyleBox (4)
- SyntaxHighlighter (2)
- Texture (3)
- Theme
- TileMapPattern
- TileSet
- TileSetSource (2)
- Translation (1)
- VideoStream (1)
- VideoStreamPlayback
- VisualShaderNode (62)
- VoxelGIData
- World2D
- World3D
- X509Certificate
VisualShaderNode

- VisualShaderNodeBillboard
- VisualShaderNodeClamp
- VisualShaderNodeColorFunc
- VisualShaderNodeColorOp
- VisualShaderNodeCompare
- VisualShaderNodeConstant (9)
- VisualShaderNodeCubemap
- VisualShaderNodeCustom
- VisualShaderNodeDerivativeFunc
- VisualShaderNodeDeterminant
- VisualShaderNodeDistanceFade
- VisualShaderNodeDotProduct
- VisualShaderNodeFloatFunc
- VisualShaderNodeFloatOp
- VisualShaderNodeFresnel
- VisualShaderNodeIf
- VisualShaderNodeInput
- VisualShaderNodeIntFunc
- VisualShaderNodeIntOp
- VisualShaderNodeIs
- VisualShaderNodeLinearSceneDepth
- VisualShaderNodeMix
- VisualShaderNodeMultiplyAdd
- VisualShaderNodeOuterProduct
- VisualShaderNodeOutput (1)
- VisualShaderNodeParameter (10)
- VisualShaderNodeParameterRef
- VisualShaderNodeParticleAccelerator
- VisualShaderNodeParticleConeVelocity
- VisualShaderNodeParticleEmit
- VisualShaderNodeParticleEmitter (4)
- VisualShaderNodeParticleMultiplyByAxisAngle
- VisualShaderNodeParticleRandomness
- VisualShaderNodeProximityFade
- VisualShaderNodeRandomRange
- VisualShaderNodeRemap
- VisualShaderNodeReroute
- VisualShaderNodeResizableBase (4)
- VisualShaderNodeRotationByAxis
- VisualShaderNodeSDFRaymarch
- VisualShaderNodeSDFToScreenUV
- VisualShaderNodeSample3D (2)
- VisualShaderNodeScreenNormalWorldSpace
- VisualShaderNodeScreenUVToSDF
- VisualShaderNodeSmoothStep
- VisualShaderNodeStep
- VisualShaderNodeSwitch
- VisualShaderNodeTexture
- VisualShaderNodeTextureSDF
- VisualShaderNodeTextureSDFNormal
- VisualShaderNodeTransformCompose
- VisualShaderNodeTransformDecompose
- VisualShaderNodeTransformFunc
- VisualShaderNodeTransformOp
- VisualShaderNodeTransformVecMult
- VisualShaderNodeUIntFunc
- VisualShaderNodeUIntOp
- VisualShaderNodeUVFunc
- VisualShaderNodeUVPolarCoord
- VisualShaderNodeVarying (2)
- VisualShaderNodeVectorBase (8)
- VisualShaderNodeWorldPositionFromDepth
VisualShaderNodeColorOp
Table of contents

VisualShaderNodeColorOp #

is_refcounted, is_instantiable, resource, core, not_builtin_classes

A Color operator to be used within the visual shader graph.

Applies operator to two color inputs.

Members #

var operator = OP_SCREEN#

An operator to be applied to the inputs. See Operator for options.

Methods #

Annotations #

Constants #

const OP_SCREEN = 0 enum Operator#

Produce a screen effect with the following formula:

result = vec3(1.0) - (vec3(1.0) - a) * (vec3(1.0) - b);

const OP_DIFFERENCE = 1 enum Operator#

Produce a difference effect with the following formula:

result = abs(a - b);

const OP_DARKEN = 2 enum Operator#

Produce a darken effect with the following formula:

result = min(a, b);

const OP_LIGHTEN = 3 enum Operator#

Produce a lighten effect with the following formula:

result = max(a, b);

const OP_OVERLAY = 4 enum Operator#

Produce an overlay effect with the following formula:

for (int i = 0; i < 3; i++) {
    float base = a[i];
    float blend = b[i];
    if (base < 0.5) {
        result[i] = 2.0 * base * blend;
    } else {
        result[i] = 1.0 - 2.0 * (1.0 - blend) * (1.0 - base);
    }
}

const OP_DODGE = 5 enum Operator#

Produce a dodge effect with the following formula:

result = a / (vec3(1.0) - b);

const OP_BURN = 6 enum Operator#

Produce a burn effect with the following formula:

result = vec3(1.0) - (vec3(1.0) - a) / b;

const OP_SOFT_LIGHT = 7 enum Operator#

Produce a soft light effect with the following formula:

for (int i = 0; i < 3; i++) {
    float base = a[i];
    float blend = b[i];
    if (base < 0.5) {
        result[i] = base * (blend + 0.5);
    } else {
        result[i] = 1.0 - (1.0 - base) * (1.0 - (blend - 0.5));
    }
}

const OP_HARD_LIGHT = 8 enum Operator#

Produce a hard light effect with the following formula:

for (int i = 0; i < 3; i++) {
    float base = a[i];
    float blend = b[i];
    if (base < 0.5) {
        result[i] = base * (2.0 * blend);
    } else {
        result[i] = 1.0 - (1.0 - base) * (1.0 - 2.0 * (blend - 0.5));
    }
}

const OP_MAX = 9 enum Operator#

Represents the size of the Operator enum.

Constructors #

Enums #

Operator#

enum Operator { OP_SCREEN = 0, OP_DIFFERENCE = 1, OP_DARKEN = 2, OP_LIGHTEN = 3, OP_OVERLAY = 4, OP_DODGE = 5, OP_BURN = 6, OP_SOFT_LIGHT = 7, OP_HARD_LIGHT = 8, OP_MAX = 9, }

Operators #

Signals #

Theme Items #

Tutorials #