What's causing bad textures in build (but not in Editor)

I have a fairly large project, and I’m running into a serious problem with textures in Unity builds. These problems never occur in the Editor.

Some textures used on character meshes come in scrambled, as if they’re coming from atlasses that are bad. Also, some textures loaded from the resource directory piecemeal are also scrambled. Other icons and textures using the same shaders are perfectly fine.

The problem is completely deterministic: the same models and resource icons are scrambled each time, from build to build, and are even the same on a different machine with the same project built from scratch.

This problem originally appeared in Unity 5.3. I upgraded to 5.4.1, but it did not fix the problem. Rebuilding the library, restarting the computer, etc. have no effect (again, this problem appears independently on two different computers, one running Windows 7 and one running Windows 10).


Two and a half years later I have the answer! With a large game, I had a lot of assets being loaded from the Resources directory. In the old Unity there was a hidden 2GB limit on assets in the resources, and this problem will persist even in Unity 2018 (at time of writing, April 2, 2019).

The solution is to move your various avatars and heavy textures, etc., into asset bundles and load them from there, instead of the Resources database. This will fix the problem.