我正在尝试实现一个支持金属的绘图应用程序,该应用程序将MTKView上沿手指位置反复用纹理正方形绘制笔触。
当我应用纹理We cannot see the texture since it is white 时。
https://imgur.com/gallery/BTnxIMl
画笔笔触的输出在半透明区域变为黑色。
我的混合是
pipelineDescriptor.colorAttachments[0].isBlendingEnabled = true
pipelineDescriptor.colorAttachments[0].rgbBlendOperation = .add
pipelineDescriptor.colorAttachments[0].alphaBlendOperation = .add
pipelineDescriptor.colorAttachments[0].sourceRGBBlendFactor = .sourceAlpha
pipelineDescriptor.colorAttachments[0].sourceAlphaBlendFactor = .one
pipelineDescriptor.colorAttachments[0].destinationRGBBlendFactor = .oneMinusSourceAlpha
pipelineDescriptor.colorAttachments[0].destinationAlphaBlendFactor = .oneMinusSourceAlpha