diff --git a/blend.go b/blend.go index db84e4af0..3e90fd163 100644 --- a/blend.go +++ b/blend.go @@ -24,20 +24,20 @@ import ( // // The default (zero) value is source-over (regular alpha blending). type Blend struct { - // BlendFactorSourceColor is a factor for source RGB values. - BlendFactorSourceColor BlendFactor + // BlendFactorSourceRGB is a factor for source RGB values. + BlendFactorSourceRGB BlendFactor // BlendFactorSourceAlpha is a factor for source alpha values. BlendFactorSourceAlpha BlendFactor - // BlendFactorDestinationColor is a factor for destination RGB values. - BlendFactorDestinationColor BlendFactor + // BlendFactorDestinationRGB is a factor for destination RGB values. + BlendFactorDestinationRGB BlendFactor // BlendFactorDestinationAlpha is a factor for destination apha values. BlendFactorDestinationAlpha BlendFactor - // BlendOperationColor is an operation for source and destination RGB values. - BlendOperationColor BlendOperation + // BlendOperationRGB is an operation for source and destination RGB values. + BlendOperationRGB BlendOperation // BlendOperationAlpha is an operation for source and destination alpha values. BlendOperationAlpha BlendOperation @@ -45,11 +45,11 @@ type Blend struct { func (b Blend) internalBlend() graphicsdriver.Blend { return graphicsdriver.Blend{ - BlendFactorSourceColor: b.BlendFactorSourceColor.internalBlendFactor(true), + BlendFactorSourceRGB: b.BlendFactorSourceRGB.internalBlendFactor(true), BlendFactorSourceAlpha: b.BlendFactorSourceAlpha.internalBlendFactor(true), - BlendFactorDestinationColor: b.BlendFactorDestinationColor.internalBlendFactor(false), + BlendFactorDestinationRGB: b.BlendFactorDestinationRGB.internalBlendFactor(false), BlendFactorDestinationAlpha: b.BlendFactorDestinationAlpha.internalBlendFactor(false), - BlendOperationColor: b.BlendOperationColor.internalBlendOperation(), + BlendOperationRGB: b.BlendOperationRGB.internalBlendOperation(), BlendOperationAlpha: b.BlendOperationAlpha.internalBlendOperation(), } } @@ -67,7 +67,7 @@ const ( BlendFactorDestinationAlpha BlendFactorOneMinusSourceAlpha BlendFactorOneMinusDestinationAlpha - BlendFactorDestinationColor + BlendFactorDestinationRGB ) func (b BlendFactor) internalBlendFactor(source bool) graphicsdriver.BlendFactor { @@ -90,8 +90,8 @@ func (b BlendFactor) internalBlendFactor(source bool) graphicsdriver.BlendFactor return graphicsdriver.BlendFactorOneMinusSourceAlpha case BlendFactorOneMinusDestinationAlpha: return graphicsdriver.BlendFactorOneMinusDestinationAlpha - case BlendFactorDestinationColor: - return graphicsdriver.BlendFactorDestinationColor + case BlendFactorDestinationRGB: + return graphicsdriver.BlendFactorDestinationRGB default: panic(fmt.Sprintf("ebiten: invalid blend factor: %d", b)) } @@ -135,132 +135,132 @@ var ( // BlendSourceOver represents the regular alpha blending. // c_out = c_src + c_dst × (1 - α_src) BlendSourceOver = Blend{ - BlendFactorSourceColor: BlendFactorOne, + BlendFactorSourceRGB: BlendFactorOne, BlendFactorSourceAlpha: BlendFactorOne, - BlendFactorDestinationColor: BlendFactorOneMinusSourceAlpha, + BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha, BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = 0 BlendClear = Blend{ - BlendFactorSourceColor: BlendFactorZero, + BlendFactorSourceRGB: BlendFactorZero, BlendFactorSourceAlpha: BlendFactorZero, - BlendFactorDestinationColor: BlendFactorZero, + BlendFactorDestinationRGB: BlendFactorZero, BlendFactorDestinationAlpha: BlendFactorZero, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_src BlendCopy = Blend{ - BlendFactorSourceColor: BlendFactorOne, + BlendFactorSourceRGB: BlendFactorOne, BlendFactorSourceAlpha: BlendFactorOne, - BlendFactorDestinationColor: BlendFactorZero, + BlendFactorDestinationRGB: BlendFactorZero, BlendFactorDestinationAlpha: BlendFactorZero, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_dst BlendDestination = Blend{ - BlendFactorSourceColor: BlendFactorZero, + BlendFactorSourceRGB: BlendFactorZero, BlendFactorSourceAlpha: BlendFactorZero, - BlendFactorDestinationColor: BlendFactorOne, + BlendFactorDestinationRGB: BlendFactorOne, BlendFactorDestinationAlpha: BlendFactorOne, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_src × (1 - α_dst) + c_dst BlendDestinationOver = Blend{ - BlendFactorSourceColor: BlendFactorOneMinusDestinationAlpha, + BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha, BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha, - BlendFactorDestinationColor: BlendFactorOne, + BlendFactorDestinationRGB: BlendFactorOne, BlendFactorDestinationAlpha: BlendFactorOne, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_src × α_dst BlendSourceIn = Blend{ - BlendFactorSourceColor: BlendFactorDestinationAlpha, + BlendFactorSourceRGB: BlendFactorDestinationAlpha, BlendFactorSourceAlpha: BlendFactorDestinationAlpha, - BlendFactorDestinationColor: BlendFactorZero, + BlendFactorDestinationRGB: BlendFactorZero, BlendFactorDestinationAlpha: BlendFactorZero, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_dst × α_src BlendDestinationIn = Blend{ - BlendFactorSourceColor: BlendFactorZero, + BlendFactorSourceRGB: BlendFactorZero, BlendFactorSourceAlpha: BlendFactorZero, - BlendFactorDestinationColor: BlendFactorSourceAlpha, + BlendFactorDestinationRGB: BlendFactorSourceAlpha, BlendFactorDestinationAlpha: BlendFactorSourceAlpha, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_src × (1 - α_dst) BlendSourceOut = Blend{ - BlendFactorSourceColor: BlendFactorOneMinusDestinationAlpha, + BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha, BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha, - BlendFactorDestinationColor: BlendFactorZero, + BlendFactorDestinationRGB: BlendFactorZero, BlendFactorDestinationAlpha: BlendFactorZero, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_dst × (1 - α_src) BlendDestinationOut = Blend{ - BlendFactorSourceColor: BlendFactorOneMinusDestinationAlpha, + BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha, BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha, - BlendFactorDestinationColor: BlendFactorZero, + BlendFactorDestinationRGB: BlendFactorZero, BlendFactorDestinationAlpha: BlendFactorZero, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_src × α_dst + c_dst × (1 - α_src) BlendSourceAtop = Blend{ - BlendFactorSourceColor: BlendFactorDestinationAlpha, + BlendFactorSourceRGB: BlendFactorDestinationAlpha, BlendFactorSourceAlpha: BlendFactorDestinationAlpha, - BlendFactorDestinationColor: BlendFactorOneMinusSourceAlpha, + BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha, BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_src × (1 - α_dst) + c_dst × α_src BlendDestinationAtop = Blend{ - BlendFactorSourceColor: BlendFactorOneMinusDestinationAlpha, + BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha, BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha, - BlendFactorDestinationColor: BlendFactorSourceAlpha, + BlendFactorDestinationRGB: BlendFactorSourceAlpha, BlendFactorDestinationAlpha: BlendFactorSourceAlpha, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // c_out = c_src × (1 - α_dst) + c_dst × (1 - α_src) BlendXor = Blend{ - BlendFactorSourceColor: BlendFactorOneMinusDestinationAlpha, + BlendFactorSourceRGB: BlendFactorOneMinusDestinationAlpha, BlendFactorSourceAlpha: BlendFactorOneMinusDestinationAlpha, - BlendFactorDestinationColor: BlendFactorOneMinusSourceAlpha, + BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha, BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } // Sum of source and destination (a.k.a. 'plus' or 'additive') // c_out = c_src + c_dst BlendLighter = Blend{ - BlendFactorSourceColor: BlendFactorOne, + BlendFactorSourceRGB: BlendFactorOne, BlendFactorSourceAlpha: BlendFactorOne, - BlendFactorDestinationColor: BlendFactorOne, + BlendFactorDestinationRGB: BlendFactorOne, BlendFactorDestinationAlpha: BlendFactorOne, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } ) diff --git a/graphics.go b/graphics.go index e0a786b9b..c6ac57141 100644 --- a/graphics.go +++ b/graphics.go @@ -80,7 +80,7 @@ const ( // Deprecated: as of v2.5. Use BlendLighter instead. CompositeModeLighter - // Deprecated: as of v2.5. Use Blend with BlendFactorDestinationColor and BlendFactorZero instead. + // Deprecated: as of v2.5. Use Blend with BlendFactorDestinationRGB and BlendFactorZero instead. CompositeModeMultiply ) @@ -114,11 +114,11 @@ func (c CompositeMode) blend() Blend { return BlendLighter case CompositeModeMultiply: return Blend{ - BlendFactorSourceColor: BlendFactorDestinationColor, - BlendFactorSourceAlpha: BlendFactorDestinationColor, - BlendFactorDestinationColor: BlendFactorZero, + BlendFactorSourceRGB: BlendFactorDestinationRGB, + BlendFactorSourceAlpha: BlendFactorDestinationRGB, + BlendFactorDestinationRGB: BlendFactorZero, BlendFactorDestinationAlpha: BlendFactorZero, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } default: diff --git a/image_test.go b/image_test.go index a22891143..d16eb664b 100644 --- a/image_test.go +++ b/image_test.go @@ -3607,11 +3607,11 @@ func TestImageBlendOperation(t *testing.T) { dst.WritePixels(dstPix) op := &ebiten.DrawImageOptions{} op.Blend = ebiten.Blend{ - BlendFactorSourceColor: ebiten.BlendFactorOne, + BlendFactorSourceRGB: ebiten.BlendFactorOne, BlendFactorSourceAlpha: ebiten.BlendFactorOne, - BlendFactorDestinationColor: ebiten.BlendFactorOne, + BlendFactorDestinationRGB: ebiten.BlendFactorOne, BlendFactorDestinationAlpha: ebiten.BlendFactorOne, - BlendOperationColor: cop, + BlendOperationRGB: cop, BlendOperationAlpha: aop, } dst.DrawImage(src, op) diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index 6548a2003..f6e58a485 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -277,11 +277,11 @@ type drawTrianglesCommand struct { func (c *drawTrianglesCommand) String() string { // TODO: Improve readability blend := fmt.Sprintf("{src-color: %d, src-alpha: %d, dst-color: %d, dst-alpha: %d, op-color: %d, op-alpha: %d}", - c.blend.BlendFactorSourceColor, + c.blend.BlendFactorSourceRGB, c.blend.BlendFactorSourceAlpha, - c.blend.BlendFactorDestinationColor, + c.blend.BlendFactorDestinationRGB, c.blend.BlendFactorDestinationAlpha, - c.blend.BlendOperationColor, + c.blend.BlendOperationRGB, c.blend.BlendOperationAlpha) dst := fmt.Sprintf("%d", c.dst.id) diff --git a/internal/graphicsdriver/blend.go b/internal/graphicsdriver/blend.go index 3f62e2350..d2007b2a7 100644 --- a/internal/graphicsdriver/blend.go +++ b/internal/graphicsdriver/blend.go @@ -15,11 +15,11 @@ package graphicsdriver type Blend struct { - BlendFactorSourceColor BlendFactor + BlendFactorSourceRGB BlendFactor BlendFactorSourceAlpha BlendFactor - BlendFactorDestinationColor BlendFactor + BlendFactorDestinationRGB BlendFactor BlendFactorDestinationAlpha BlendFactor - BlendOperationColor BlendOperation + BlendOperationRGB BlendOperation BlendOperationAlpha BlendOperation } @@ -32,7 +32,7 @@ const ( BlendFactorDestinationAlpha BlendFactorOneMinusSourceAlpha BlendFactorOneMinusDestinationAlpha - BlendFactorDestinationColor + BlendFactorDestinationRGB ) type BlendOperation byte @@ -44,28 +44,28 @@ const ( ) var BlendSourceOver = Blend{ - BlendFactorSourceColor: BlendFactorOne, + BlendFactorSourceRGB: BlendFactorOne, BlendFactorSourceAlpha: BlendFactorOne, - BlendFactorDestinationColor: BlendFactorOneMinusSourceAlpha, + BlendFactorDestinationRGB: BlendFactorOneMinusSourceAlpha, BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } var BlendClear = Blend{ - BlendFactorSourceColor: BlendFactorZero, + BlendFactorSourceRGB: BlendFactorZero, BlendFactorSourceAlpha: BlendFactorZero, - BlendFactorDestinationColor: BlendFactorZero, + BlendFactorDestinationRGB: BlendFactorZero, BlendFactorDestinationAlpha: BlendFactorZero, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } var BlendCopy = Blend{ - BlendFactorSourceColor: BlendFactorOne, + BlendFactorSourceRGB: BlendFactorOne, BlendFactorSourceAlpha: BlendFactorOne, - BlendFactorDestinationColor: BlendFactorZero, + BlendFactorDestinationRGB: BlendFactorZero, BlendFactorDestinationAlpha: BlendFactorZero, - BlendOperationColor: BlendOperationAdd, + BlendOperationRGB: BlendOperationAdd, BlendOperationAlpha: BlendOperationAdd, } diff --git a/internal/graphicsdriver/directx/pipeline_windows.go b/internal/graphicsdriver/directx/pipeline_windows.go index 9cda3192c..6c8fb9478 100644 --- a/internal/graphicsdriver/directx/pipeline_windows.go +++ b/internal/graphicsdriver/directx/pipeline_windows.go @@ -39,7 +39,7 @@ func blendFactorToBlend(f graphicsdriver.BlendFactor, alpha bool) _D3D12_BLEND { return _D3D12_BLEND_INV_SRC_ALPHA case graphicsdriver.BlendFactorOneMinusDestinationAlpha: return _D3D12_BLEND_INV_DEST_ALPHA - case graphicsdriver.BlendFactorDestinationColor: + case graphicsdriver.BlendFactorDestinationRGB: // D3D12_RENDER_TARGET_BLEND_DESC's *BlendAlpha members don't allow *_COLOR values. // See https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_render_target_blend_desc. if alpha { @@ -423,9 +423,9 @@ func (p *pipelineStates) newPipelineState(device *_ID3D12Device, vsh, psh *_ID3D { BlendEnable: 1, LogicOpEnable: 0, - SrcBlend: blendFactorToBlend(blend.BlendFactorSourceColor, false), - DestBlend: blendFactorToBlend(blend.BlendFactorDestinationColor, false), - BlendOp: blendOperationToBlendOp(blend.BlendOperationColor), + SrcBlend: blendFactorToBlend(blend.BlendFactorSourceRGB, false), + DestBlend: blendFactorToBlend(blend.BlendFactorDestinationRGB, false), + BlendOp: blendOperationToBlendOp(blend.BlendOperationRGB), SrcBlendAlpha: blendFactorToBlend(blend.BlendFactorSourceAlpha, true), DestBlendAlpha: blendFactorToBlend(blend.BlendFactorDestinationAlpha, true), BlendOpAlpha: blendOperationToBlendOp(blend.BlendOperationAlpha), diff --git a/internal/graphicsdriver/metal/graphics_darwin.go b/internal/graphicsdriver/metal/graphics_darwin.go index c73de0630..c77e3b10c 100644 --- a/internal/graphicsdriver/metal/graphics_darwin.go +++ b/internal/graphicsdriver/metal/graphics_darwin.go @@ -314,8 +314,8 @@ func blendFactorToMetalBlendFactor(c graphicsdriver.BlendFactor) mtl.BlendFactor return mtl.BlendFactorOneMinusSourceAlpha case graphicsdriver.BlendFactorOneMinusDestinationAlpha: return mtl.BlendFactorOneMinusDestinationAlpha - case graphicsdriver.BlendFactorDestinationColor: - return mtl.BlendFactorDestinationColor + case graphicsdriver.BlendFactorDestinationRGB: + return mtl.BlendFactorDestinationRGB default: panic(fmt.Sprintf("metal: invalid blend factor: %d", c)) } diff --git a/internal/graphicsdriver/metal/mtl/mtl_darwin.go b/internal/graphicsdriver/metal/mtl/mtl_darwin.go index 99bddbd0b..dda7b41d3 100644 --- a/internal/graphicsdriver/metal/mtl/mtl_darwin.go +++ b/internal/graphicsdriver/metal/mtl/mtl_darwin.go @@ -271,11 +271,11 @@ type BlendFactor uint8 const ( BlendFactorZero BlendFactor = 0 BlendFactorOne BlendFactor = 1 - BlendFactorSourceColor BlendFactor = 2 + BlendFactorSourceRGB BlendFactor = 2 BlendFactorOneMinusSourceColor BlendFactor = 3 BlendFactorSourceAlpha BlendFactor = 4 BlendFactorOneMinusSourceAlpha BlendFactor = 5 - BlendFactorDestinationColor BlendFactor = 6 + BlendFactorDestinationRGB BlendFactor = 6 BlendFactorOneMinusDestinationColor BlendFactor = 7 BlendFactorDestinationAlpha BlendFactor = 8 BlendFactorOneMinusDestinationAlpha BlendFactor = 9 diff --git a/internal/graphicsdriver/metal/shader_darwin.go b/internal/graphicsdriver/metal/shader_darwin.go index ca5113603..1c7c95d3c 100644 --- a/internal/graphicsdriver/metal/shader_darwin.go +++ b/internal/graphicsdriver/metal/shader_darwin.go @@ -113,11 +113,11 @@ func (s *Shader) RenderPipelineState(view *view, blend graphicsdriver.Blend, ste rpld.ColorAttachments[0].BlendingEnabled = true rpld.ColorAttachments[0].DestinationAlphaBlendFactor = blendFactorToMetalBlendFactor(blend.BlendFactorDestinationAlpha) - rpld.ColorAttachments[0].DestinationRGBBlendFactor = blendFactorToMetalBlendFactor(blend.BlendFactorDestinationColor) + rpld.ColorAttachments[0].DestinationRGBBlendFactor = blendFactorToMetalBlendFactor(blend.BlendFactorDestinationRGB) rpld.ColorAttachments[0].SourceAlphaBlendFactor = blendFactorToMetalBlendFactor(blend.BlendFactorSourceAlpha) - rpld.ColorAttachments[0].SourceRGBBlendFactor = blendFactorToMetalBlendFactor(blend.BlendFactorSourceColor) + rpld.ColorAttachments[0].SourceRGBBlendFactor = blendFactorToMetalBlendFactor(blend.BlendFactorSourceRGB) rpld.ColorAttachments[0].AlphaBlendOperation = blendOperationToMetalBlendOperation(blend.BlendOperationAlpha) - rpld.ColorAttachments[0].RGBBlendOperation = blendOperationToMetalBlendOperation(blend.BlendOperationColor) + rpld.ColorAttachments[0].RGBBlendOperation = blendOperationToMetalBlendOperation(blend.BlendOperationRGB) if stencilMode == prepareStencil { rpld.ColorAttachments[0].WriteMask = mtl.ColorWriteMaskNone diff --git a/internal/graphicsdriver/opengl/context.go b/internal/graphicsdriver/opengl/context.go index bd50e4da0..88894f414 100644 --- a/internal/graphicsdriver/opengl/context.go +++ b/internal/graphicsdriver/opengl/context.go @@ -55,7 +55,7 @@ func convertBlendFactor(f graphicsdriver.BlendFactor) blendFactor { return glOneMinusSrcAlpha case graphicsdriver.BlendFactorOneMinusDestinationAlpha: return glOneMinusDstAlpha - case graphicsdriver.BlendFactorDestinationColor: + case graphicsdriver.BlendFactorDestinationRGB: return glDstColor default: panic(fmt.Sprintf("opengl: invalid blend factor %d", f)) diff --git a/internal/graphicsdriver/opengl/context_gl.go b/internal/graphicsdriver/opengl/context_gl.go index 40bb58de4..0b9b0b44f 100644 --- a/internal/graphicsdriver/opengl/context_gl.go +++ b/internal/graphicsdriver/opengl/context_gl.go @@ -119,13 +119,13 @@ func (c *context) blend(blend graphicsdriver.Blend) { } c.lastBlend = blend gl.BlendFuncSeparate( - uint32(convertBlendFactor(blend.BlendFactorSourceColor)), - uint32(convertBlendFactor(blend.BlendFactorDestinationColor)), + uint32(convertBlendFactor(blend.BlendFactorSourceRGB)), + uint32(convertBlendFactor(blend.BlendFactorDestinationRGB)), uint32(convertBlendFactor(blend.BlendFactorSourceAlpha)), uint32(convertBlendFactor(blend.BlendFactorDestinationAlpha)), ) gl.BlendEquationSeparate( - uint32(convertBlendOperation(blend.BlendOperationColor)), + uint32(convertBlendOperation(blend.BlendOperationRGB)), uint32(convertBlendOperation(blend.BlendOperationAlpha)), ) } diff --git a/internal/graphicsdriver/opengl/context_gles.go b/internal/graphicsdriver/opengl/context_gles.go index 9ceff4db2..3c9e27ac5 100644 --- a/internal/graphicsdriver/opengl/context_gles.go +++ b/internal/graphicsdriver/opengl/context_gles.go @@ -109,13 +109,13 @@ func (c *context) blend(blend graphicsdriver.Blend) { return } c.ctx.BlendFuncSeparate( - uint32(convertBlendFactor(blend.BlendFactorSourceColor)), - uint32(convertBlendFactor(blend.BlendFactorDestinationColor)), + uint32(convertBlendFactor(blend.BlendFactorSourceRGB)), + uint32(convertBlendFactor(blend.BlendFactorDestinationRGB)), uint32(convertBlendFactor(blend.BlendFactorSourceAlpha)), uint32(convertBlendFactor(blend.BlendFactorDestinationAlpha)), ) c.ctx.BlendEquationSeparate( - uint32(convertBlendOperation(blend.BlendOperationColor)), + uint32(convertBlendOperation(blend.BlendOperationRGB)), uint32(convertBlendOperation(blend.BlendOperationAlpha)), ) } diff --git a/internal/graphicsdriver/opengl/context_js.go b/internal/graphicsdriver/opengl/context_js.go index 581627b35..d9d7b122c 100644 --- a/internal/graphicsdriver/opengl/context_js.go +++ b/internal/graphicsdriver/opengl/context_js.go @@ -192,13 +192,13 @@ func (c *context) blend(blend graphicsdriver.Blend) { c.lastBlend = blend gl := c.gl gl.blendFuncSeparate.Invoke( - int(convertBlendFactor(blend.BlendFactorSourceColor)), - int(convertBlendFactor(blend.BlendFactorDestinationColor)), + int(convertBlendFactor(blend.BlendFactorSourceRGB)), + int(convertBlendFactor(blend.BlendFactorDestinationRGB)), int(convertBlendFactor(blend.BlendFactorSourceAlpha)), int(convertBlendFactor(blend.BlendFactorDestinationAlpha)), ) gl.blendEquationSeparate.Invoke( - int(convertBlendOperation(blend.BlendOperationColor)), + int(convertBlendOperation(blend.BlendOperationRGB)), int(convertBlendOperation(blend.BlendOperationAlpha)), ) }