mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 03:58:55 +01:00
internal/graphicscommand: better debug info for blending
This commit is contained in:
parent
39c21bf4a6
commit
7f87ecaddc
172
blend.go
172
blend.go
@ -179,6 +179,33 @@ func (b BlendFactor) internalBlendFactor(source bool) graphicsdriver.BlendFactor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func internalBlendFactorToBlendFactor(blendFactor graphicsdriver.BlendFactor) BlendFactor {
|
||||||
|
switch blendFactor {
|
||||||
|
case graphicsdriver.BlendFactorZero:
|
||||||
|
return BlendFactorZero
|
||||||
|
case graphicsdriver.BlendFactorOne:
|
||||||
|
return BlendFactorOne
|
||||||
|
case graphicsdriver.BlendFactorSourceColor:
|
||||||
|
return BlendFactorSourceColor
|
||||||
|
case graphicsdriver.BlendFactorOneMinusSourceColor:
|
||||||
|
return BlendFactorOneMinusSourceColor
|
||||||
|
case graphicsdriver.BlendFactorSourceAlpha:
|
||||||
|
return BlendFactorSourceAlpha
|
||||||
|
case graphicsdriver.BlendFactorOneMinusSourceAlpha:
|
||||||
|
return BlendFactorOneMinusSourceAlpha
|
||||||
|
case graphicsdriver.BlendFactorDestinationColor:
|
||||||
|
return BlendFactorDestinationColor
|
||||||
|
case graphicsdriver.BlendFactorOneMinusDestinationColor:
|
||||||
|
return BlendFactorOneMinusDestinationColor
|
||||||
|
case graphicsdriver.BlendFactorDestinationAlpha:
|
||||||
|
return BlendFactorDestinationAlpha
|
||||||
|
case graphicsdriver.BlendFactorOneMinusDestinationAlpha:
|
||||||
|
return BlendFactorOneMinusDestinationAlpha
|
||||||
|
default:
|
||||||
|
panic(fmt.Sprintf("ebiten: invalid blend factor: %d", blendFactor))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// BlendOperation is an operation for source and destination color values.
|
// BlendOperation is an operation for source and destination color values.
|
||||||
type BlendOperation byte
|
type BlendOperation byte
|
||||||
|
|
||||||
@ -233,6 +260,34 @@ func (b BlendOperation) internalBlendOperation() graphicsdriver.BlendOperation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func internalBlendOperationToBlendOperation(blendOperation graphicsdriver.BlendOperation) BlendOperation {
|
||||||
|
switch blendOperation {
|
||||||
|
case graphicsdriver.BlendOperationAdd:
|
||||||
|
return BlendOperationAdd
|
||||||
|
case graphicsdriver.BlendOperationSubtract:
|
||||||
|
return BlendOperationSubtract
|
||||||
|
case graphicsdriver.BlendOperationReverseSubtract:
|
||||||
|
return BlendOperationReverseSubtract
|
||||||
|
case graphicsdriver.BlendOperationMin:
|
||||||
|
return BlendOperationMin
|
||||||
|
case graphicsdriver.BlendOperationMax:
|
||||||
|
return BlendOperationMax
|
||||||
|
default:
|
||||||
|
panic(fmt.Sprintf("ebiten: invalid blend operation: %d", blendOperation))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func internalBlendToBlend(blend graphicsdriver.Blend) Blend {
|
||||||
|
return Blend{
|
||||||
|
BlendFactorSourceRGB: internalBlendFactorToBlendFactor(blend.BlendFactorSourceRGB),
|
||||||
|
BlendFactorSourceAlpha: internalBlendFactorToBlendFactor(blend.BlendFactorSourceAlpha),
|
||||||
|
BlendFactorDestinationRGB: internalBlendFactorToBlendFactor(blend.BlendFactorDestinationRGB),
|
||||||
|
BlendFactorDestinationAlpha: internalBlendFactorToBlendFactor(blend.BlendFactorDestinationAlpha),
|
||||||
|
BlendOperationRGB: internalBlendOperationToBlendOperation(blend.BlendOperationRGB),
|
||||||
|
BlendOperationAlpha: internalBlendOperationToBlendOperation(blend.BlendOperationAlpha),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This name convention follows CSS compositing: https://drafts.fxtf.org/compositing-2/.
|
// This name convention follows CSS compositing: https://drafts.fxtf.org/compositing-2/.
|
||||||
//
|
//
|
||||||
// In the comments,
|
// In the comments,
|
||||||
@ -242,169 +297,78 @@ var (
|
|||||||
//
|
//
|
||||||
// c_out = c_src + c_dst × (1 - α_src)
|
// c_out = c_src + c_dst × (1 - α_src)
|
||||||
// α_out = α_src + α_dst × (1 - α_src)
|
// α_out = α_src + α_dst × (1 - α_src)
|
||||||
BlendSourceOver = Blend{
|
BlendSourceOver = internalBlendToBlend(graphicsdriver.BlendSourceOver)
|
||||||
BlendFactorSourceRGB: BlendFactorOne,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorOne,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendClear is a preset Blend for Porter Duff's 'clear'.
|
// BlendClear is a preset Blend for Porter Duff's 'clear'.
|
||||||
//
|
//
|
||||||
// c_out = 0
|
// c_out = 0
|
||||||
// α_out = 0
|
// α_out = 0
|
||||||
BlendClear = Blend{
|
BlendClear = internalBlendToBlend(graphicsdriver.BlendClear)
|
||||||
BlendFactorSourceRGB: BlendFactorZero,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorZero,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorZero,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorZero,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendCopy is a preset Blend for Porter Duff's 'copy'.
|
// BlendCopy is a preset Blend for Porter Duff's 'copy'.
|
||||||
//
|
//
|
||||||
// c_out = c_src
|
// c_out = c_src
|
||||||
// α_out = α_src
|
// α_out = α_src
|
||||||
BlendCopy = Blend{
|
BlendCopy = internalBlendToBlend(graphicsdriver.BlendCopy)
|
||||||
BlendFactorSourceRGB: BlendFactorOne,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorOne,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorZero,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorZero,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendDestination is a preset Blend for Porter Duff's 'destination'.
|
// BlendDestination is a preset Blend for Porter Duff's 'destination'.
|
||||||
//
|
//
|
||||||
// c_out = c_dst
|
// c_out = c_dst
|
||||||
// α_out = α_dst
|
// α_out = α_dst
|
||||||
BlendDestination = Blend{
|
BlendDestination = internalBlendToBlend(graphicsdriver.BlendDestination)
|
||||||
BlendFactorSourceRGB: BlendFactorZero,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorZero,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorOne,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorOne,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendDestinationOver is a preset Blend for Porter Duff's 'destination-over'.
|
// BlendDestinationOver is a preset Blend for Porter Duff's 'destination-over'.
|
||||||
//
|
//
|
||||||
// c_out = c_src × (1 - α_dst) + c_dst
|
// c_out = c_src × (1 - α_dst) + c_dst
|
||||||
// α_out = α_src × (1 - α_dst) + α_dst
|
// α_out = α_src × (1 - α_dst) + α_dst
|
||||||
BlendDestinationOver = Blend{
|
BlendDestinationOver = internalBlendToBlend(graphicsdriver.BlendDestinationOver)
|
||||||
BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorOne,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorOne,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendSourceIn is a preset Blend for Porter Duff's 'source-in'.
|
// BlendSourceIn is a preset Blend for Porter Duff's 'source-in'.
|
||||||
//
|
//
|
||||||
// c_out = c_src × α_dst
|
// c_out = c_src × α_dst
|
||||||
// α_out = α_src × α_dst
|
// α_out = α_src × α_dst
|
||||||
BlendSourceIn = Blend{
|
BlendSourceIn = internalBlendToBlend(graphicsdriver.BlendSourceIn)
|
||||||
BlendFactorSourceRGB: BlendFactorDestinationAlpha,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorDestinationAlpha,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorZero,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorZero,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendDestinationIn is a preset Blend for Porter Duff's 'destination-in'.
|
// BlendDestinationIn is a preset Blend for Porter Duff's 'destination-in'.
|
||||||
//
|
//
|
||||||
// c_out = c_dst × α_src
|
// c_out = c_dst × α_src
|
||||||
// α_out = α_dst × α_src
|
// α_out = α_dst × α_src
|
||||||
BlendDestinationIn = Blend{
|
BlendDestinationIn = internalBlendToBlend(graphicsdriver.BlendDestinationIn)
|
||||||
BlendFactorSourceRGB: BlendFactorZero,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorZero,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorSourceAlpha,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorSourceAlpha,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendSourceOut is a preset Blend for Porter Duff's 'source-out'.
|
// BlendSourceOut is a preset Blend for Porter Duff's 'source-out'.
|
||||||
//
|
//
|
||||||
// c_out = c_src × (1 - α_dst)
|
// c_out = c_src × (1 - α_dst)
|
||||||
// α_out = α_src × (1 - α_dst)
|
// α_out = α_src × (1 - α_dst)
|
||||||
BlendSourceOut = Blend{
|
BlendSourceOut = internalBlendToBlend(graphicsdriver.BlendSourceOut)
|
||||||
BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorZero,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorZero,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendDestinationOut is a preset Blend for Porter Duff's 'destination-out'.
|
// BlendDestinationOut is a preset Blend for Porter Duff's 'destination-out'.
|
||||||
//
|
//
|
||||||
// c_out = c_dst × (1 - α_src)
|
// c_out = c_dst × (1 - α_src)
|
||||||
// α_out = α_dst × (1 - α_src)
|
// α_out = α_dst × (1 - α_src)
|
||||||
BlendDestinationOut = Blend{
|
BlendDestinationOut = internalBlendToBlend(graphicsdriver.BlendDestinationOut)
|
||||||
BlendFactorSourceRGB: BlendFactorZero,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorZero,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendSourceAtop is a preset Blend for Porter Duff's 'source-atop'.
|
// BlendSourceAtop is a preset Blend for Porter Duff's 'source-atop'.
|
||||||
//
|
//
|
||||||
// c_out = c_src × α_dst + c_dst × (1 - α_src)
|
// c_out = c_src × α_dst + c_dst × (1 - α_src)
|
||||||
// α_out = α_src × α_dst + α_dst × (1 - α_src)
|
// α_out = α_src × α_dst + α_dst × (1 - α_src)
|
||||||
BlendSourceAtop = Blend{
|
BlendSourceAtop = internalBlendToBlend(graphicsdriver.BlendSourceAtop)
|
||||||
BlendFactorSourceRGB: BlendFactorDestinationAlpha,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorDestinationAlpha,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendDestinationAtop is a preset Blend for Porter Duff's 'destination-atop'.
|
// BlendDestinationAtop is a preset Blend for Porter Duff's 'destination-atop'.
|
||||||
//
|
//
|
||||||
// c_out = c_src × (1 - α_dst) + c_dst × α_src
|
// c_out = c_src × (1 - α_dst) + c_dst × α_src
|
||||||
// α_out = α_src × (1 - α_dst) + α_dst × α_src
|
// α_out = α_src × (1 - α_dst) + α_dst × α_src
|
||||||
BlendDestinationAtop = Blend{
|
BlendDestinationAtop = internalBlendToBlend(graphicsdriver.BlendDestinationAtop)
|
||||||
BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorSourceAlpha,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorSourceAlpha,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendXor is a preset Blend for Porter Duff's 'xor'.
|
// BlendXor is a preset Blend for Porter Duff's 'xor'.
|
||||||
//
|
//
|
||||||
// c_out = c_src × (1 - α_dst) + c_dst × (1 - α_src)
|
// c_out = c_src × (1 - α_dst) + c_dst × (1 - α_src)
|
||||||
// α_out = α_src × (1 - α_dst) + α_dst × (1 - α_src)
|
// α_out = α_src × (1 - α_dst) + α_dst × (1 - α_src)
|
||||||
BlendXor = Blend{
|
BlendXor = internalBlendToBlend(graphicsdriver.BlendXor)
|
||||||
BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
|
|
||||||
// BlendLighter is a preset Blend for Porter Duff's 'lighter'.
|
// BlendLighter is a preset Blend for Porter Duff's 'lighter'.
|
||||||
// This is sum of source and destination (a.k.a. 'plus' or 'additive')
|
// This is sum of source and destination (a.k.a. 'plus' or 'additive')
|
||||||
//
|
//
|
||||||
// c_out = c_src + c_dst
|
// c_out = c_src + c_dst
|
||||||
// α_out = α_src + α_dst
|
// α_out = α_src + α_dst
|
||||||
BlendLighter = Blend{
|
BlendLighter = internalBlendToBlend(graphicsdriver.BlendLighter)
|
||||||
BlendFactorSourceRGB: BlendFactorOne,
|
|
||||||
BlendFactorSourceAlpha: BlendFactorOne,
|
|
||||||
BlendFactorDestinationRGB: BlendFactorOne,
|
|
||||||
BlendFactorDestinationAlpha: BlendFactorOne,
|
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
@ -81,6 +81,24 @@ func (c *drawTrianglesCommand) String() string {
|
|||||||
blend = "(clear)"
|
blend = "(clear)"
|
||||||
case graphicsdriver.BlendCopy:
|
case graphicsdriver.BlendCopy:
|
||||||
blend = "(copy)"
|
blend = "(copy)"
|
||||||
|
case graphicsdriver.BlendDestination:
|
||||||
|
blend = "(destination)"
|
||||||
|
case graphicsdriver.BlendSourceIn:
|
||||||
|
blend = "(source-in)"
|
||||||
|
case graphicsdriver.BlendDestinationIn:
|
||||||
|
blend = "(destination-in)"
|
||||||
|
case graphicsdriver.BlendSourceOut:
|
||||||
|
blend = "(source-out)"
|
||||||
|
case graphicsdriver.BlendDestinationOut:
|
||||||
|
blend = "(destination-out)"
|
||||||
|
case graphicsdriver.BlendSourceAtop:
|
||||||
|
blend = "(source-atop)"
|
||||||
|
case graphicsdriver.BlendDestinationAtop:
|
||||||
|
blend = "(destination-atop)"
|
||||||
|
case graphicsdriver.BlendXor:
|
||||||
|
blend = "(xor)"
|
||||||
|
case graphicsdriver.BlendLighter:
|
||||||
|
blend = "(lighter)"
|
||||||
default:
|
default:
|
||||||
blend = fmt.Sprintf("{src-rgb: %d, src-alpha: %d, dst-rgb: %d, dst-alpha: %d, op-rgb: %d, op-alpha: %d}",
|
blend = fmt.Sprintf("{src-rgb: %d, src-alpha: %d, dst-rgb: %d, dst-alpha: %d, op-rgb: %d, op-alpha: %d}",
|
||||||
c.blend.BlendFactorSourceRGB,
|
c.blend.BlendFactorSourceRGB,
|
||||||
|
@ -51,29 +51,121 @@ const (
|
|||||||
BlendOperationMax
|
BlendOperationMax
|
||||||
)
|
)
|
||||||
|
|
||||||
var BlendSourceOver = Blend{
|
var (
|
||||||
BlendFactorSourceRGB: BlendFactorOne,
|
BlendSourceOver = Blend{
|
||||||
BlendFactorSourceAlpha: BlendFactorOne,
|
BlendFactorSourceRGB: BlendFactorOne,
|
||||||
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
BlendFactorSourceAlpha: BlendFactorOne,
|
||||||
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
}
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
var BlendClear = Blend{
|
BlendClear = Blend{
|
||||||
BlendFactorSourceRGB: BlendFactorZero,
|
BlendFactorSourceRGB: BlendFactorZero,
|
||||||
BlendFactorSourceAlpha: BlendFactorZero,
|
BlendFactorSourceAlpha: BlendFactorZero,
|
||||||
BlendFactorDestinationRGB: BlendFactorZero,
|
BlendFactorDestinationRGB: BlendFactorZero,
|
||||||
BlendFactorDestinationAlpha: BlendFactorZero,
|
BlendFactorDestinationAlpha: BlendFactorZero,
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
}
|
}
|
||||||
|
|
||||||
var BlendCopy = Blend{
|
BlendCopy = Blend{
|
||||||
BlendFactorSourceRGB: BlendFactorOne,
|
BlendFactorSourceRGB: BlendFactorOne,
|
||||||
BlendFactorSourceAlpha: BlendFactorOne,
|
BlendFactorSourceAlpha: BlendFactorOne,
|
||||||
BlendFactorDestinationRGB: BlendFactorZero,
|
BlendFactorDestinationRGB: BlendFactorZero,
|
||||||
BlendFactorDestinationAlpha: BlendFactorZero,
|
BlendFactorDestinationAlpha: BlendFactorZero,
|
||||||
BlendOperationRGB: BlendOperationAdd,
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
BlendOperationAlpha: BlendOperationAdd,
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlendDestination = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorZero,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorZero,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorOne,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorOne,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendDestinationOver = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorOne,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorOne,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendSourceIn = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorDestinationAlpha,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorDestinationAlpha,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorZero,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorZero,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendDestinationIn = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorZero,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorZero,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorSourceAlpha,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorSourceAlpha,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendSourceOut = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorZero,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorZero,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendDestinationOut = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorZero,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorZero,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendSourceAtop = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorDestinationAlpha,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorDestinationAlpha,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendDestinationAtop = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorSourceAlpha,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorSourceAlpha,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendXor = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
|
||||||
|
BlendLighter = Blend{
|
||||||
|
BlendFactorSourceRGB: BlendFactorOne,
|
||||||
|
BlendFactorSourceAlpha: BlendFactorOne,
|
||||||
|
BlendFactorDestinationRGB: BlendFactorOne,
|
||||||
|
BlendFactorDestinationAlpha: BlendFactorOne,
|
||||||
|
BlendOperationRGB: BlendOperationAdd,
|
||||||
|
BlendOperationAlpha: BlendOperationAdd,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user