enable blending

This commit is contained in:
Samuliak 2024-07-02 11:33:53 +02:00
parent 4b00041748
commit e653d2f6f7

View file

@ -105,6 +105,11 @@ void RendererMTL::initGraphicsContext(SDL_Window* window) {
// HACK // HACK
auto* drawColorAttachment = drawPipelineDescriptor->colorAttachments()->object(0); auto* drawColorAttachment = drawPipelineDescriptor->colorAttachments()->object(0);
drawColorAttachment->setPixelFormat(topScreenTexture->pixelFormat()); drawColorAttachment->setPixelFormat(topScreenTexture->pixelFormat());
drawColorAttachment->setBlendingEnabled(true);
drawColorAttachment->setSourceRGBBlendFactor(MTL::BlendFactorSourceAlpha);
drawColorAttachment->setDestinationRGBBlendFactor(MTL::BlendFactorOneMinusSourceAlpha);
drawColorAttachment->setSourceAlphaBlendFactor(MTL::BlendFactorSourceAlpha);
drawColorAttachment->setDestinationAlphaBlendFactor(MTL::BlendFactorOneMinusSourceAlpha);
// -------- Vertex descriptor -------- // -------- Vertex descriptor --------
MTL::VertexDescriptor* vertexDescriptor = MTL::VertexDescriptor::alloc()->init(); MTL::VertexDescriptor* vertexDescriptor = MTL::VertexDescriptor::alloc()->init();