RDPipelineColorBlendStateAttachment
Pipeline color blend state attachment (used by RenderingDevice
).
class RDPipelineColorBlendStateAttachment
Controls how blending between source and destination fragments is performed when using RenderingDevice
.
For reference, this is how common user-facing blend modes are implemented in Godot’s 2D renderer:
Mix:
Add:
Subtract:
Multiply:
Pre-multiplied alpha:
Superclasses
class RefCounted
Base class for reference-counted objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var alphaBlendOp: RenderingDevice.BlendOperation
The blend mode to use for the alpha channel.
var colorBlendOp: RenderingDevice.BlendOperation
The blend mode to use for the red/green/blue color channels.
var dstAlphaBlendFactor: RenderingDevice.BlendFactor
Controls how the blend factor for the alpha channel is determined based on the destination’s fragments.
var dstColorBlendFactor: RenderingDevice.BlendFactor
Controls how the blend factor for the color channels is determined based on the destination’s fragments.
var enableBlend: Bool
If
true
, performs blending between the source and destination according to the factors defined insrcColorBlendFactor
,dstColorBlendFactor
,srcAlphaBlendFactor
anddstAlphaBlendFactor
. The blend modescolorBlendOp
andalphaBlendOp
are also taken into account, withwriteR
,writeG
,writeB
andwriteA
controlling the output.var srcAlphaBlendFactor: RenderingDevice.BlendFactor
Controls how the blend factor for the alpha channel is determined based on the source’s fragments.
var srcColorBlendFactor: RenderingDevice.BlendFactor
Controls how the blend factor for the color channels is determined based on the source’s fragments.
var writeA: Bool
If
true
, writes the new alpha channel to the final result.var writeB: Bool
If
true
, writes the new blue color channel to the final result.var writeG: Bool
If
true
, writes the new green color channel to the final result.var writeR: Bool
If
true
, writes the new red color channel to the final result.func setAsMix(
) Convenience method to perform standard mix blending with straight (non-premultiplied) alpha. This sets
enableBlend
totrue
,srcColorBlendFactor
tosrcAlpha
,dstColorBlendFactor
tooneMinusSrcAlpha
,srcAlphaBlendFactor
tosrcAlpha
anddstAlphaBlendFactor
tooneMinusSrcAlpha
.