<blending> (//pfx/pipeline/blending)

<blending> element configures blending for colour attachments

<blending> element configures blending for colour attachments. It may be defined for all framebuffer colour attachments at once, or for each separately. If no alpha blending is required, this element should be omitted.

The blend function is

OutputColor = SrcColor * SrcColorFactor [ColorOp] DstColor * DstColorFactor
OutputAlpha = SrcAlpha * SrcAlphaFactor [AlphaOp] DstAlpha* DstAlphaFactor

with the exception of the MIN and MAX operations, that ignore the src and dst factors.

XML Attributes (<blending> element)

ATTRIBUTE

Description

index

(OPTIONAL) The colour attachment that this blending configuration applies to. If not defined, applies to all colour attachments

enabled

(OPTIONAL) Set to true to enable alpha blending, false to disable.

Default false

{src/dst}{Color,Alpha}Factor

(OPTIONAL) Set the blend factor for the specified item {srcColorFactor, srcAlphaFactor, dstColorFactor, dstAlphaFactor}.

Valid values: zero, one, srcColor, oneMinusSrcColor, srcAlpha, oneMinusSrcAlpha, dstColor, oneMinusDstColor, dstAlpha, oneMinusDstAlpha.

Default - Src: one, Dst: zero

{color,alpha}BlendOp

(OPTIONAL) Set the blend operation for the specified item (Color or Alpha.

Valid values: add, subtract, reverseSubtract, min, max

Default: add

writeMask

(OPTIONAL) Set the color write mask.

Valid values: none or any combination of 'rgba'

Default: rgba