Hello, I want to render metal with a transparent background on top of a gradient layer.
I have set the clearColor alpha to 0 renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(1.0, 1.0, 1.0, 0.0)
My metal render displays as I expect but the background is white, not transparent.
I tried setting the metal layer view opaque = false, background still white.
What am I missing??
Thanks.
Fritzt, Thanks for your reply.
In the process of trying out your suggestion I found a bug in my code that resolved my issue.
Blending is not necessary, loadAction = .Clear and a clearColor with alpha 0.0 creates a transparant background.
FYI my graident layer background is screen size and my Metal layer is smaller so the transparent background is simple to do. Calculating the graident in the Metal layer to match the graident background would be... well I'm really not sure how I would do it.