- Home /
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).
Help!
Answer by Dreadflame · Apr 02, 2019 at 05:42 PM
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.
Your answer
Follow this Question
Related Questions
Using TexturePacker for Texture2ds 0 Answers
1 x 8192x8192px texture atlas VS 32 x 1024x1024px individual textures 2 Answers
Can you use a texture atlas as a colorpicker? 1 Answer
Texture Atlasing only beneficial with Batching? 0 Answers
More materials smaller texture size vs less materials bigger texture size 0 Answers