Can Texture2D save images with transparent background? Can we use Texture2D with transparent background directly to achieve the effect of transparent image overlaying in Metal shade?
2024-01-15 17:26:25
Texture2D can save images with a transparent background. In Texture2D, a separate alpha channel is typically used to describe the transparency of background pixels. In Metal’s fragment shader, colors and alpha values of each pixel can be obtained by sampling the texture, and they can be used for subsequent processing.