I’m trying to get a transparent background in Unreal Engine scene, so I can place another UIView behind UE4 view. I have achieved this by setting:
- clearColor on MTLRenderPassColorAttachmentDescriptor to f.e. MTLClearColorMake(0.0, 0, 0, 1.0)
- opaque on CAMetalLayer to false
but the background UIView blends with the UE4 view’s foreground: table, chairs, and floor as if the UE4 view itself was translucent: screenshot with bleed-through.
I’m pretty new to Metal, so I cannot fully grasp where I could disable translucency computation in the code.
Also, is there an easy way to generate black&transparent masks at runtime?