It just uses a round image as a Mask.
When set to iOS Target, a strange pattern appears on the corners.
This did not occur in Unity 2020.3.18 and occurred in Unity 2021.3.16.
Here is the repository that reproduces it. https://github.com/kyubuns/BugReportUiMask
Does anyone know the cause or workaround for this?
For unity developer
I have already sent a bug report on this issue.
IN-28938
I had the same issue with the editor. I managed to solve by changing the mask ‘format’ in the sprite inspector from ‘automatic’ to ‘RGBA 32 bit.’ I haven’t checked the built version yet, but I believe that exploring the platform-specific format options might do the trick in that case too.
Same issue, checked everywhere on forums and bug reports and none of the proposed solutions worked for us.
Happened after moving from 2020 to 2022
I debbuged this very deeply and from what i saw it seems to be an issue with the way iOS is packaging single Sprites in Sprite Atlases.
The texture attached to the Image with the mask component is coming from the auto generated Sprite Atlas, and by inspecting that atlas, I saw that there were some imprecisions: some values that were supposed to have an alpha of 0, had alphas of 0.003. I could not figure out why because the original texture had none of that. I also tried all approaches i saw around the forums about this issue, none of which worked.
The image associated with the mask has a color property that seems to be mostly ignored during rendering. But it seems that while rendering, it does some sort of operation with the alpha channel
of that image and from the texture attached to it. The fix was changing that color value in the mask associated Image. While its alpha was 1, there were all these inconsistencies but when i got it very close to 0 but not 0, everything was rendering fine. I settled up with a value of 0.02.
Which makes sense if you read the UI/Default shader
When i get that value very close to 0 the pixels with alpha = 1 in the texture still render fine because the multiplication is still above that threshold of 0.001 but the weird generated super small alpha values don’t