My game has some overlapping sprites. I’m using Sprites-Default shader. Some sprites have it’s color alpha component with a value less than 1 (so they are semi-transparent). If I set alpha component to 1 instead, will my game run faster?
as far I know the answer is yes. (i am not an expert tho).
by setting the alpha to 1 the camera will just render the image in the front (which is lesser than rendering overlapping images with alpha less than 1 – it will render more than one images at a time effecting the performance).
although it may not have a noticeable change if your game is simple or do not have complex scenes and too much images to render.
(hope this helps a bit. This is my first answer to any unity forums tho.
).
Good Luck for your game.
Thanks @irfan-ayub_1 . It makes sense. But, is it possible that performance is the same because the shader is already checking pixels behind the sprite, although alpha is 1?
@pep_dj yes it is the exact same case you just said, the shader will still look for the pixels and the performance will be the same so if you want to make these sprites (images) invisible or set their alpha to 1 at any point so you can just deactivate these images ( by SetActive(false) ) as per your need and make them active again (by SetActive(True) ) if you need, this will definitely increase the performance.
Thanks for correcting me thanks… ![]()
Anyone can confirm it? Is there a performance penalty setting alpha < 1 using Sprites-Default shader?