Areas of textures are black on iOS

This only affects PNG textures.

There is an issue where areas of a texture may appear black on PNG textures. The areas that are black are where the alpha channel on those pixels are 0 or near zero and the PNG is used just for RGB. (Some projects use the alpha channel to store data such as which areas represent the face of a character.

This is because iOS Safari/Webkit will premultiply the alpha channel with the RGB on loading PNGs. (this is also what causes the banding issues on lightmaps here: Weird texture .exr .hdr artifacts on IOS device · Issue #1930 · playcanvas/engine · GitHub

We are looking at alternative ways to load the PNG but for the short term to get around this, use texture compression (which means the browser is no longer loading a PNG) or have two textures (JPG), one the alpha channel ‘data’ and the other for the RGB.

Also note that iOS 15 has dropped PVR texture compression support. I believe it only supports ASTC and ETC1 now.

2 Likes