GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::BlendState Struct Reference

Blend state used in a ShaderPipelineOptions. More...

#include <GREM/graphics/shaders.hpp>

Public Member Functions

constexpr bool operator== (const BlendState &other) const noexcept=default
 Compare this blend state to another for equality.

Public Attributes

BlendFactor sourceColorBlendFactor = BlendFactor::ONE
 Blend factor of the source color.
BlendFactor destinationColorBlendFactor = BlendFactor::ZERO
 Blend factor of the destination color.
BlendOperation colorBlendOperation = BlendOperation::ADD
 Color blend operation.
BlendFactor sourceAlphaBlendFactor = BlendFactor::ONE
 Blend factor of the source alpha.
BlendFactor destinationAlphaBlendFactor = BlendFactor::ZERO
 Blend factor of the destination alpha.
BlendOperation alphaBlendOperation = BlendOperation::ADD
 Alpha blend operation.
Color blendConstants = Color::WHITE
 Constant blend color.

Static Public Attributes

static const BlendState ALPHA_BLENDING_STRAIGHT
 Blend state to use for straight alpha blending using the standard "over" operator.
static const BlendState ALPHA_BLENDING_PREMULTIPLIED
 Blend state to use for pre-multiplied alpha blending using the standard "over" operator.

Detailed Description

Member Function Documentation

◆ operator==()

bool grem::graphics::BlendState::operator== ( const BlendState & other) const
nodiscardconstexprdefaultnoexcept

Compare this blend state to another for equality.

Parameters
otherthe blend state to compare this one to.
Returns
true if the blend states are equal, false otherwise.

Member Data Documentation

◆ ALPHA_BLENDING_STRAIGHT

BlendState grem::graphics::BlendState::ALPHA_BLENDING_STRAIGHT
inlinestaticconstexpr
Initial value:
{
.sourceColorBlendFactor = BlendFactor::SOURCE_ALPHA,
.destinationColorBlendFactor = BlendFactor::ONE_MINUS_SOURCE_ALPHA,
.sourceAlphaBlendFactor = BlendFactor::ONE,
.destinationAlphaBlendFactor = BlendFactor::ONE_MINUS_SOURCE_ALPHA,
}
@ SOURCE_ALPHA
Multiply all components by the source alpha.
Definition shaders.hpp:360
@ ONE_MINUS_SOURCE_ALPHA
Multiply all components by 1 minus the source alpha.
Definition shaders.hpp:361
@ ONE
Multiply all components by 1.
Definition shaders.hpp:355

Blend state to use for straight alpha blending using the standard "over" operator.

◆ ALPHA_BLENDING_PREMULTIPLIED

BlendState grem::graphics::BlendState::ALPHA_BLENDING_PREMULTIPLIED
inlinestaticconstexpr
Initial value:
{
.sourceColorBlendFactor = BlendFactor::ONE,
.destinationColorBlendFactor = BlendFactor::ONE_MINUS_SOURCE_ALPHA,
.sourceAlphaBlendFactor = BlendFactor::ONE,
.destinationAlphaBlendFactor = BlendFactor::ONE_MINUS_SOURCE_ALPHA,
}

Blend state to use for pre-multiplied alpha blending using the standard "over" operator.

◆ sourceColorBlendFactor

BlendFactor grem::graphics::BlendState::sourceColorBlendFactor = BlendFactor::ONE

Blend factor of the source color.

◆ destinationColorBlendFactor

BlendFactor grem::graphics::BlendState::destinationColorBlendFactor = BlendFactor::ZERO

Blend factor of the destination color.

◆ colorBlendOperation

BlendOperation grem::graphics::BlendState::colorBlendOperation = BlendOperation::ADD

Color blend operation.

◆ sourceAlphaBlendFactor

BlendFactor grem::graphics::BlendState::sourceAlphaBlendFactor = BlendFactor::ONE

Blend factor of the source alpha.

◆ destinationAlphaBlendFactor

BlendFactor grem::graphics::BlendState::destinationAlphaBlendFactor = BlendFactor::ZERO

Blend factor of the destination alpha.

◆ alphaBlendOperation

BlendOperation grem::graphics::BlendState::alphaBlendOperation = BlendOperation::ADD

Alpha blend operation.

◆ blendConstants

Color grem::graphics::BlendState::blendConstants = Color::WHITE

Constant blend color.


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