added NonPremultiplied BlendMode

This commit is contained in:
Noel 2022-05-28 09:38:38 -07:00
parent 410adbfe12
commit d2703e5050
2 changed files with 14 additions and 1 deletions

View File

@ -113,8 +113,10 @@ namespace Blah
// BlendMode using for rendering
struct BlendMode
{
// Normal, pre-multiplied, Blend Mode
// Normal is Premultipled Alpha
// TODO: potentially rename normal to match that it is for Premultiplied Alpha?
static const BlendMode Normal;
static const BlendMode NonPremultiplied;
static const BlendMode Subtract;
static const BlendMode Additive;

View File

@ -14,6 +14,17 @@ const BlendMode BlendMode::Normal = BlendMode(
0xffffffff
);
const BlendMode BlendMode::NonPremultiplied = BlendMode(
BlendOp::Add,
BlendFactor::SrcAlpha,
BlendFactor::OneMinusSrcAlpha,
BlendOp::Add,
BlendFactor::SrcAlpha,
BlendFactor::OneMinusSrcAlpha,
BlendMask::RGBA,
0xffffffff
);
const BlendMode BlendMode::Subtract = BlendMode(
BlendOp::ReverseSubtract,
BlendFactor::One,