We started having this really strange issue out of the blue. Some sprites get corrupted but only in (Windows) builds. There are no problems when the game is run from the editor.
Here’s how the corrupted sprites look in the build. The one on the left works correctly, the one on the right is all messed up.
It is a really puzzling problem and we have never encountered anything similar on this project for the last year. Furthermore this corruption issue started appearing on sprites that were fine just weeks ago. We tried every single solution we could think of. Our conclusions are these:
-
It’s not a problem with the file itself. We tried deleting, copying, recreating from the source and nothing helps. The file is read correctly in the Editor and in every single software application as well.
-
It’s not a problem with the import settings. Both of the icons in the picture above have the same settings and are identical in terms of size, file format, etc.
-
It’s not related to the way the sprite is presented - the issue occurs both in regular Sprite Renderers and UI Image elements and is also presented when already present in the scene and when instantiated.
-
It doesn’t seem to be hardware related. We tried building and running on various hw configurations including laptops. We tested on both dedicated GPUs (nVidias) and intergated Intel cards. We also tried updating drivers - no difference. All computers were running Windows 10 though.
-
The corrupted sprites really seem to have nothing in common in terms of their properties. The issue manifests on both transparent and opaque sprites, of various sizes and colour palettes.
-
Deleting the ‘Library’ folder and reimporting assets does not help. We tried this solution on two different computers.
-
The corrupted sprites work correctly when the scene that presents them is the first scene in the build order - this is utterly confusing. If the scene is loaded directly after the application runs everything is fine. If it’s loaded into from the other scene however, it’s broken.
-
We are on Unity 5.3 and it might be a problem related to this, however there is nothing like this in the Issue Tracker. We also couldn’t find anything similar while searching through the internet forums. We tried building on 5.3.1 up to the recent 5.3.5 - no difference.
Any assistance would be GREATLY appreciated.