LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::BlendDescriptor Struct Reference

Blending state descriptor structure. More...

#include <PipelineStateFlags.h>

Public Attributes

bool alphaToCoverageEnabled = false
 Specifies whether to use alpha-to-coverage as a multi-sampling technique when setting a pixel to a render target. By default disabled.
bool independentBlendEnabled = false
 Specifies whether to enable independent blending in simultaneous color attachments. By default false.
bool blendFactorDynamic = false
 Specifies whether the blend factor will be set dynamically with the command buffer. By default false.
std::uint32_t sampleMask = ~0u
 Specifies the sample bitmask if alpha coverage is enabled. By default 0xFFFFFFFF.
LogicOp logicOp = LogicOp::Disabled
 Specifies the logic fragment operation. By default LogicOp::Disabled.
float blendFactor [4] = { 0.0f, 0.0f, 0.0f, 0.0f }
 Specifies the blending color factor. By default (0, 0, 0, 0).
BlendTargetDescriptor targets [LLGL_MAX_NUM_COLOR_ATTACHMENTS]
 Render-target blend states for the respective color attachments. A maximum of 8 targets is supported.

Detailed Description

Blending state descriptor structure.

See also
GraphicsPipelineDescriptor::blend

Member Data Documentation

◆ alphaToCoverageEnabled

bool LLGL::BlendDescriptor::alphaToCoverageEnabled = false

Specifies whether to use alpha-to-coverage as a multi-sampling technique when setting a pixel to a render target. By default disabled.

Remarks
This is useful when multi-sampling is enabled and alpha tests are implemented in a fragment shader (e.g. to render fences, plants, or other transparent geometries).
See also
sampleMask

◆ blendFactor

float LLGL::BlendDescriptor::blendFactor[4] = { 0.0f, 0.0f, 0.0f, 0.0f }

Specifies the blending color factor. By default (0, 0, 0, 0).

Remarks
This is only used if any blending operations of any blending target is either BlendOp::BlendFactor or BlendOp::InvBlendFactor.
If blendFactorDynamic is set to true, this member is ignored.
See also
BlendOp::BlendFactor
BlendOp::InvBlendFactor
CommandBuffer::SetBlendFactor

◆ blendFactorDynamic

bool LLGL::BlendDescriptor::blendFactorDynamic = false

Specifies whether the blend factor will be set dynamically with the command buffer. By default false.

Remarks
If this is true, blendFactor is ignored and the blending factors must be set with the SetBlendFactor function everytime the graphics pipeline is set.
See also
CommandBuffer::SetBlendFactor

◆ independentBlendEnabled

bool LLGL::BlendDescriptor::independentBlendEnabled = false

Specifies whether to enable independent blending in simultaneous color attachments. By default false.

Remarks
If this is true, each color attachment has its own blending configuration described in the targets array. Otherwise, each color attachment uses the blending configuration described only by the first entry of the targets array, i.e. targets[0] and all remaining entries targets[1..7] are ignored.
See also
targets

◆ logicOp

LogicOp LLGL::BlendDescriptor::logicOp = LogicOp::Disabled

Specifies the logic fragment operation. By default LogicOp::Disabled.

Remarks
Logic pixel operations can not be used in combination with color and alpha blending. Therefore, if this is not LogicOp::Disabled, independentBlendEnabled must be false and blendEnabled of the first target must be false as well. If logic fragment operations are not supported by the renderer, this must be LogicOp::Disabled.
Note
For Direct3D 11, feature level 11.1 is required.
See also
blendEnabled
RenderingFeatures::hasLogicOp

◆ sampleMask

std::uint32_t LLGL::BlendDescriptor::sampleMask = ~0u

Specifies the sample bitmask if alpha coverage is enabled. By default 0xFFFFFFFF.

Remarks
If alphaToCoverageEnabled is false, this field is ignored.
See also
alphaToCoverageEnabled

◆ targets

BlendTargetDescriptor LLGL::BlendDescriptor::targets[LLGL_MAX_NUM_COLOR_ATTACHMENTS]

Render-target blend states for the respective color attachments. A maximum of 8 targets is supported.

Remarks
If independentBlendEnabled is set to false, only the first entry is used, i.e. targets[0] and all remaining entries targets[1..7] are ignored.
If the first target uses a dual-source blending operation (i.e. BlendOp::Src1Color, BlendOp::InvSrc1Color, BlendOp::Src1Alpha, or BlendOp::InvSrc1Alpha), only the first target can be used. Using dual-source blending with more than one render target is undefined behavior.
See also
independentBlendEnabled

The documentation for this struct was generated from the following file: