Custom 2D Sprite Shader + iPhone13

as you see this happen if you using new version of Unity 2021++ and it only happen on iphone13
there have a white glow on edge of sprites, and you can try test it

and I found the way to found this problem exact like iPhone13 without use real device (iphone13)
by open Unity 2021 or more and use a custom sprite Shader in some object and just search it by name

this have a white glow on sprite, and this sprite draw by custom shader

you can test by using this simple shader for 2d Sprite
https://www.hardworkerstudio.com/Download/2DSprite.shader

if you not search it not happen like this

I hope the new version of Unity can fix this issue. I love Unity so much!!!

Thanks!!!

Are you using PSD files? Because this looks like the problem you would have when you uncheck the “Remove Matte” in PSD file’s import settings. Maybe it’s broken in iOS?

1 Like

No I just used .PNG and some objects I also enabled Remove Matte PSD in importer setting but this still happen
so if I downgrade to lower version of Unity this bug will gone…

How many threads are you going to open about this?

I asked to provide the shader and a png file in another so I could help debug this, but instead of continuing that conversation there you keep opening new threads.

1 Like

Thank you very much for your answer
I think I enough for this threads, I just waiting for someone to see this because this is a big problem I cannot continue doing my work if this bug is not fix I hope Unity team can see this issue.

if you want try to test this, by open Unity 2021 or latest version
and you can download this my custom sprite shader and add to some sprite
this shader is very simple and then searching the sprite name
then you can see how it happen like this


as this image you can see a little white edge out of these sprite
or you can try to test on real device (iphone13) it should be the best…

Thanks

In Unity’s original Sprite shader they multiply the alpha to the color, which is basically what you’re now doing in your custom shader:
colorTexture.rgb *= colorTexture.a;

this is because they use this blend mode:
Blend One OneMinusSrcAlpha

This is called Premultiplied Alpha, and I think is faster than usual alpha blending.
The bug looks as if on iOS it’s using the wrong blending, and causes the white edges.

1 Like

Thank you very much
I have to try using texture.rgb * texture.a
I hope it can fix this issue

Yes I understand how edge white But what is this?

Thank you very very much!!!
I finally can fix it by use your concept by multiply color with alpha of it’s texture
and I go to find default Sprite Shader too I found that use color * with alpha too
but the blend is set to Blend One OneMinusSrcAlpha instead of use source alpha first

so I finally did it!!!

In case anyone else encounters this bug - it is caused by the device being in Light Mode. If you switch to Dark Mode you will see all the white outlines disappear. You can force your game to run with Dark Mode UI by editing the info.plist. More info here: iphone - Unity shader glitches according to the Dark Mode on iOS 15 - Stack Overflow

Finally, they can now continue doing their work now that its no longer stopped them