BlendMode Struct Reference

BlendMode wraps the blend state (BlendFunc+'enabled' bool) and provides some human friendly blend mode names. More...

List of all members.

Public Member Functions

 BlendMode (bool enabled, BlendFunc blend_func)
 Constructor.

Public Attributes

bool Enabled
 Blend enabled flag.
BlendFunc BlendFunc
 Blend function.

Static Public Attributes

static BlendMode None = new BlendMode( false, new BlendFunc( BlendFuncMode.Add, BlendFuncFactor.One, BlendFuncFactor.One ) )
 No alpha blend: dst = src.
static BlendMode Normal = new BlendMode( true, new BlendFunc( BlendFuncMode.Add, BlendFuncFactor.SrcAlpha, BlendFuncFactor.OneMinusSrcAlpha ) )
 Normal alpha blend: dst = lerp( dst, src, src.a )
static BlendMode Additive = new BlendMode( true, new BlendFunc( BlendFuncMode.Add, BlendFuncFactor.One, BlendFuncFactor.One ) )
 Additive alpha blend: dst = dst + src.
static BlendMode Multiplicative = new BlendMode( true, new BlendFunc( BlendFuncMode.Add, BlendFuncFactor.DstColor, BlendFuncFactor.Zero ) )
 Multiplicative alpha blend: dst = dst * src.
static BlendMode PremultipliedAlpha = new BlendMode( true, new BlendFunc( BlendFuncMode.Add, BlendFuncFactor.One, BlendFuncFactor.OneMinusSrcAlpha ) )
 Premultiplied alpha blend: dst = dst * (1-src.a ) + src.

Detailed Description

BlendMode wraps the blend state (BlendFunc+'enabled' bool) and provides some human friendly blend mode names.