Search Unity

Textures messed up in Windows Build

Discussion in 'General Graphics' started by ShilohGames, Nov 11, 2016.

  1. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    I ran into a problem today that I have never seen before. My game looks fine when playing in the Unity Editor, but the textures are messed up when I play in a standalone Windows build. Both of these screenshots are from the same computer. It is a Windows 10 computer with a GTX 780 card. I have never seen this happen before. Is there something obvious I need to check in my project? Thanks.

    Screenshot from Unity Editor:


    Screenshot from Windows build:
     
    Last edited: Nov 13, 2016
  2. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    I tried reimporting the assets that had messed up textures. That did not help.

    Next, I tried reimporting all of the assets in my project. It took a couple hours. Unfortunately, it did not help. I am still seeing exactly the same problem. All of the textures look fine when playing my game in the Unity Editor, but the textures are messed up in the Windows build.
     
  3. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    I also read through the Editor.log file after I did a Windows build of my project. It does not report anything missing in the log file during the build.

    Does anybody have any suggestions for other things to check?
     
  4. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    Next thing I am going to try is upgrading Unity from 5.4.2p1 to 5.4.2p4.
     
  5. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    Updating to Unity 5.4.2p4 did not help either.
     
  6. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    I still have not found a solution to this problem. I am not even sure what to call the problem when searching for solutions. What would you call the problem? It just looks like Unity is generating random colored dots instead of using the materials. Is there a graphics term to call that problem? Thanks.
     
  7. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I'm having the excact same issue, in editor its working fine, but on build some textures go like that.
     
  8. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I'm using 5.4.4, deferred, linear, hd, on mine its affecting the rocks, UI, some tree billboards, and some weapons, and scopes
     
  9. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
  10. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    @ShilohGames Have you tried deleting the 'Library' folder, from the root. I was gonna do it but didn't wanna spent an hour waiting for it to recompile and end up the exact same. It's weird its just suddenly happened too.
     
  11. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    I am using deferred, gamma, and HDR.

    I have not tried deleting the Library folder yet, but it is probably one of my next things to try.
     
  12. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    Here is another image from today where the Windows build has messed up textures on certain models in the scene. The ship in the foreground has a bunch of random noise in its texture, but that same ship looks great when I play my game in the Unity Editor.


    I have tried a number of things. I tried the "Generate Lightmap UVs" option on models. I tried clearing and rebaking lightmaps. I have tried reimporting everything.

    One thing that helped a little bit was deleting some of the disabled objects I had in my scene. Once I cleaned out the scene as much as possible, the 3D model for the first person cockpit started displaying properly again.

    Honestly, at this point, I am suspecting that this problem is simply a bug in Unity, but I don't know how I managed to suddenly run into it.

    I am really hoping that somebody from Unity will tell me what the problem is called and how to fix it.
     
  13. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I've deleted the Library folder gonna see if makes a difference, also I read that it could be related to having a large amount of textures in a build or resources. I do have a lot of textures which most I don't use, so I'm also gonna remove them before I try a new build.

    I'll post later my results JIm
     
  14. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi, deleting the Library folder didn't help, just took 5 hours to recompile. So don't do that, but what worked was to get the textures in the build under 4gb, before I had just over 4gb, now i've been through all textures removed a load and lowered the res on some, and it's under 3gb. I done a test and all is perfect.

    I use a asset called 'Build Report Tool' I would recommend it, it will tell you exactly what you are using.

    Hope this helps Jim
     
    EricMay and HakJak like this.
  15. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    I think you might be on to something regarding textures in the build. I installed "Build Report Tool" asset in my project, rebuilt my project, and then viewed the build report tool. In my build, I currently have about 5GB of textures. If there is a 4GB hard limit in Unity during a build, then that would explain why certain textures seem broken in the build.

    I see obvious ways I can reduce the total amount of textures in my project. I would like to hear from somebody at Unity about whether or not there is a 4GB texture limit in builds. If there is a 4GB limit, I would like to know why.
     
    llJIMBOBll likes this.
  16. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    I trimmed my texture usage until I got it down to 3.9GB, so I am under the assumed 4GB texture limit now. Now all of the textures are fine/normal in my Windows build. While this is fantastic, this is a frustrating limit. I was planning to add a couple GB of additional textures to my game before launch.
     
    llJIMBOBll likes this.
  17. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
  18. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
  19. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
  20. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,389
  21. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,844
    I also voted on that one.
     
  22. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,389
    Today I relented, lowered all my textures to import 512, and now the problem has gone "for now" until I need good textures again :) ... at least I can make a build for the first time in 12 months.
     
  23. gringan

    gringan

    Joined:
    Oct 27, 2016
    Posts:
    42
  24. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,389
    Yes its still an issue, you need to lower your textures in the build to less than 4 gig.
     
  25. AbdoHachem324

    AbdoHachem324

    Joined:
    Apr 28, 2019
    Posts:
    1
    Hey everyone!
    I think I might be a bit late but I know the solution to this issue.
    For the longest time I was facing the same issue (where everything looks perfect in the editor, but as soon as I build... DISASTER).

    All I had to do was make sure all of my Scenes were baked and removed any extra GameObjects I wasn't using, in addition to removing scripts/assets that were not being used by my game.

    Of course, baking might take several hours (one of my scenes took 6 hours to bake). But as soon as it was over. The build ran perfectly!

    Good luck, and I hope this solution works for you too!

     
  26. themeshpotato

    themeshpotato

    Joined:
    Apr 11, 2018
    Posts:
    55
    I'm experiencing this as well and I really need to know why this limitation is even there and whst I can do to resolve it besides just compressing everything even more?
    Anyone from Unity have an answer to this?
     
  27. rafi2017

    rafi2017

    Joined:
    Feb 1, 2018
    Posts:
    3
    Having same issue on Unity 2018.3, once resources.assets cross the 4GB limit, the texture on the built EXE get wiered artifacts...

    Is there any way to instruct build process to split "resource.assets file into multiple smaller files
     
  28. cholleme

    cholleme

    Unity Technologies

    Joined:
    Apr 23, 2019
    Posts:
    19
    This thread has been going for a while, so there could be some different issues at play here from bugs, to graphics driver bugs, to simply running out of (GPU) memory.

    @rafi2017 could you maybe submit a simple repro of that issue you are describing as a bug report?
     
  29. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,389
    In this thread ( https://forum.unity.com/threads/bug-4gb-limit-to-textures-in-standalone-build.441116/ ) they explain the limitation well and it will be fixed in unity 2020, they have worked VERY hard to fix this for us.. just a shame there was no real error message in first place. @karl_jones Is the (voluntary) go between for this issue, which involves him dodging spears from all the angry users and the unity devs themselves, I think he has done an amazing job and I thank him very much for his efforts in fixing this bug (and all them hard working coders who blow our minds every release). Who knows maybe we will get some more tricks from it.. the inbuilt resource system is what shipped and what we love, and is FAR less confusing than the other systems, so we can hope, but even lifting this 4 gig limit will change all of our lives.
     
  30. zarex7

    zarex7

    Joined:
    Jan 25, 2016
    Posts:
    21
    2020.1 bug still exist
     
  31. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,389
    yes, 2020 still alpha I think it will be in the real release.
     
  32. OzgurGurbuz

    OzgurGurbuz

    Joined:
    Jun 18, 2019
    Posts:
    7
    Sorry to waking this up but same problem occured today. I fixed the problem by unticking the "Texture Mipmap Stripping" option which located in Project Settings/Player/Other Settings. Maybe it can help someone.
     
    radiantboy likes this.
  33. smsmsmsms

    smsmsmsms

    Joined:
    Dec 18, 2020
    Posts:
    2
    Same problem occuring to my project. Unity version 2019.4.21f1.
    Now I don't see any way to publish my game properly...It is difficult to reduce texture size that much.
     
unityunity