We’re in the optimization phase of our game and we’ve gotten pointers towards transparency/alpha in textures/sprites being quite costly to render. So I’ve checked out the ‘Alpha Source’ setting on our Textures and tried to change it to ‘None’ from ‘Input Texture Alpha’. The thing is, it seems to do nothing. Profiler showed no change and there are no visible changes. Anyone know what this setting does?
Also, if Alpha Source is set to ‘None’ you can’t change ‘Alpha Is Transparency’, but it still seems like the Texture is still using whatever ‘Alpha Is Transparency’ is set to (see photos). Bug?
(Nothing more infuriating than getting a big flashy 5.5 update with settings that don’t work/do anything…)
What shader or what material are you using with this texture?
If you are using a transparent material (shader), whether your texture has an alpha channel or not it will still be treated as transparent object which causes your performance problem.
The texture itself using / having alpha is almost irrelevant to performance, it’s purely if the shader & material being used by the sprite is considered to be opaque or not. If you have a sprite texture with no alpha and use it with the default sprite shader it will be just as expensive to render as a sprite texture with alpha, and even possibly more so as Unity won’t be able to pack that sprite as efficiently.
You’re probably going to want to look into something like SpriteSharp.
It should work with any sprite shader, though the main benefit of SpriteSharp is it’s ability to make high quality, low poly meshes from a sprites’s alpha which you can then use opaque sprite shaders with. I would direct further questions to the official SpriteSharp thread.