Search Unity

Texture problem : Graphical Corruptions - Need Help

Discussion in 'General Graphics' started by Noss1325, Apr 5, 2016.

  1. Noss1325

    Noss1325

    Joined:
    Mar 5, 2015
    Posts:
    12
    Hello all,

    As stated on the title, I have a real weird problem showing on textures. After looking everywhere in my scene, and in Unity forums, I still can't figure out how this happens.

    Here is the result of my scene in Unity Editor, like I expect to have in build :


    Here is the result when I simply build :


    • I tried this on Unity 5.3.3f1, and 5.3.4f1, and builds on PC 64x.
    • The graphical corruption only occurs in build, never in editor.
    • Corruptions shows up only on textures using Unity 5 Standard Specular.
    • In my scene, I used only Unity 5 Standard (simple and specular) Shaders. And I only have one custom script for camera control (a simple free cam).
    • All textures are DTX5 compressed.
    • The more I add textures in the scene, the more I can see corruptions showing up randomly. I obtained this result while having about 500 textures in the scene.

    And this is one of the texture (shown broken in build) properties when selected in Unity :


    Is this a Unity known bug ? Please I need help on this.
     
    Last edited: Apr 5, 2016
    radiantboy and uiniti like this.
  2. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    Finally (joke,I wish you had not to deal with this bug) another person with this problem.
    We have had this issue since 5.3.0 and still having it on 5.3.4p1.

    We think it may be caused by a problem with Unity while it builds the assets because it happens on several different materials from standard to speedtree and sometimes we have spotted other textures in the place of the one where there were artifacts.

    Our resource.assets.ress is 4.7GB. On 5.2 it was 2.5GB. We don't know why and we think it may cause by surpassing the limit of 4GB as there was a similar limit on Unity 4.x but lower, unfortunately we couldn't find any mention of that in the manual.

    Building only the main scene doesn't present artifacts where are usually shown: the resource.assets.ress size i 3.4GB.

    We managed to make a build with the file size lowered to 4.3GB and there seems to be less textures having these problems.
     
  3. cblarsen

    cblarsen

    Joined:
    Mar 10, 2007
    Posts:
    266
    Did you guys make an error report to Unity Tech?
    It looks to me like some rendertextures used internally by Unity for lighting get pushed out of graphics card memory when there are a lot of other textures. So with less memory on the graphics card it would happen even sooner.
     
  4. Noss1325

    Noss1325

    Joined:
    Mar 5, 2015
    Posts:
    12
    Seeing your answer made me have the same thought :)

    Well, same thing happens here, but not sure it has to do with build size since I did builds of other scenes with a size of 8Gbytes without any problem. Moreover, each time you want to lower build size, you remove more meshes, which envolves having less textures in the scene.

    Not yey, I wanted to start by forums. I will do if nobody can help by the end of the day.
    Here is my PC config :
    • Graphics : NVIDIA GeForce GTX 970 with 4096Mbytes Type: GDDR5.
    • Memory : 16 GBytes DDR4.
    • CPU : Inter Core I7 6700K.
     
    uiniti likes this.
  5. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    yes we did few days ago.

    I don't know but as I said, building the main scene only doesn't present any problem.

    We have this problem on several configurations GTX 970, GTX 750ti, GTX 560 and another one I don't recall
     
  6. Alloc

    Alloc

    Joined:
    Jun 5, 2013
    Posts:
    241
    Have any of you been able to solve this issue?

    I filed a bug report but so far no response, not even an acknowledgement of the issue. Another QA guy told me though they weren't able to repro and if someone knew how to repro this issue it might help (but I assume by "repro" they mean with a lightweight project, not a multi-GB full project where "anything" could cause the issue).
     
    uiniti likes this.
  7. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    having resource files below 4GB "solved" it.
    Our ticket has been marked as resolved because we used this workaround even it the issue is still there. I'm very disappointed.
     
  8. Alloc

    Alloc

    Joined:
    Jun 5, 2013
    Posts:
    241
    Yeah, if it's not a mobile platform or at least Windows it seems like support is a lot worse :(

    Anyway, are you talking about single resource file size limit to 4 GiB or all the resource files together below 4 GiB? We never had a single file above that limit but still experienced this issue.
     
  9. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    a single resource file below 4.
    The game is on Windows
     
  10. Alloc

    Alloc

    Joined:
    Jun 5, 2013
    Posts:
    241
    Hm, ok, we never had a single one over 4. Wonder if it's really the same issue then.
    Also, are you saying you actually got the issue on Windows? So far I thought this was OSX only?
     
  11. Alloc

    Alloc

    Joined:
    Jun 5, 2013
    Posts:
    241
  12. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    My issue happened on Windows 10, Directx 11 and an Nvidia card.
     
  13. igrir

    igrir

    Joined:
    Jan 24, 2014
    Posts:
    16
    I had an issue similar like this, but it wasn't deferred rendering (I posted about the issue here http://forum.unity3d.com/threads/broken-output-color-on-mac-build.406799/). And yes, it was OSX only problem. I've found the biggest resource file is resources.assets.resS and it's under 4 GB. Still don't know why.

    UPDATE
    Was resolved! Tried to build the Mac using x86_64 architecture output
     
    Last edited: May 27, 2016
  14. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I am having the exact same problem here, I have an asset that is 5.2 gig. Building on windows with Unity 5.4.2f1. It really sucks not being able to make a build to test anywhere... Anyone know if this got accepted as a bug again? I will re-report if not, we need a fix.
     
  15. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I will see if x86_64 solves it for me!!! that 4 gig limit could well be a 32 bit thing, in fact Im almost certain now, fingers crossed, thanks for the tip!.
     
  16. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Damn 64 bit does not fix it.
     
  17. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Nor does an update to 5.5 beta ;-(
     
  18. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Having the same problem, resource assets under 2gb still no fix

    Does having a uncompressed texture in the resources foldoer creates a problem?
     
    Last edited: Nov 4, 2016
    HakJak likes this.
  19. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,021
    You are not alone. I recently ran into the same problem:
    https://forum.unity3d.com/threads/textures-messed-up-in-windows-build.440675/

    If I have more than 4GB of textures in my Windows build of my game, then some of the textures will be all messed up, even though the textures look perfectly fine when playing the game through the Unity Editor.

    I am guessing there is a 32bit addressing bug in the Unity standalone build, so it cannot locate past 4GB of textures in the build. I temporarily "solved" the issue by using an asset called "Build Report Tool" to track down a list of the largest textures in my project, and then I deleted all of the textures that I did not need in my game at this time. As soon as I had less than 4GB of textures in my build, then all of the broken texture problems were magically fixed.
     
    Last edited: Nov 14, 2016
    HakJak, radiantboy and llJIMBOBll like this.
  20. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,021
    The issue does not seem to be related to total assets in the Resources folder. The issue seems to be a hard limit of 4GB on the total textures in the build. Grab the "Build Report Tool" asset. When you build your project, it will show you total texture size in the build under "Size Stats". It will say Textures, Sounds, Meshes, etc under "Used Assets Size Breakdown" on the "Size Stats" section. If the total size of Textures exceeds 4GB, you will run into the problem.
     
  21. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I'm not sure how to issue a Ticket, or maybe should @some Unity Dev Here :D
     
  22. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    @Aras @Joe_Robins @antenna tree

    Please view the posts above, there seems to be a 4GB texture limit on 64bit Builds.
     
  23. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,021
    Yeah, the problem here is that the bug only shows up in large projects. It is hard to make a small repro case to submit as a bug report when the problem literally only happens in large projects. Somebody from Unity needs to comment on these threads. I did submit a bug report, but I did not submit my entire project since the source for that project is over 30GB. I just submitted links to the forum threads.
     
  24. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
  25. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    does that mean this wont be "fixed"? we should move to asset bundles? damn really cant be bothered doing that lol.
     
  26. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    radiantboy likes this.
  27. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Thanks i will give that a read, I am presuming there is some automated way to make asset bundles, and some convenient way to still work with the files etc and not have to make them each time, and certainly to not have to load things from code. Seems like a bit of a workaround that could cause us to focus on this and not the fun part of making the game, indeed it has already stalled everything for me just weeks before I was due to release a demo, now I cannot. Anyway time to learn asset bundles I guess :)))

     
    Last edited: Nov 19, 2016
  28. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
  29. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    karl_jones likes this.
  30. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    karl_jones likes this.
  31. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
  32. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    anyone ever get around this? seems silly I have waited a year to make a build and I still cannot!!! I find the Asset Bundle Graph Tool is basically unusable too right now. Unity has so many bugs stopping me move forward, and it has wrecked ALL animations in my game too.. tough times to be a unity dev ;-(
     
  33. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    @radiantboy Does this limitation only apply to textures in a resources folder or is it anywhere in the project hierarchy?

    p.s. Don't worry, you probably know how it is with development on Unity by now, it goes in cycles, ups and downs. You're probably in the soul-crushing "stuff not working" period, but the light will return lol, the exciting, creative phase will come back around again.

    That animation thing... I seem to remember reading somewhere that a new version of Unity introduced an extra bone for humanoid rigs (another spine bone I think) to more closely resemble something like 3ds Max biped for example. Perhaps this is related?
     
    radiantboy likes this.
  34. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Hey man :) Thanks for the words of encouragement, looking forward to getting back into that exciting phase for sure!! Unity can demoralise at times, but of course it can do the exact opposite too most of the time!..

    The 4 gig thing is basically when you make a build, if any of your .asset files exceed 4 gig of textures then I think it happens.

    Animation, im not sure someone just told me to try reimporting the avatars. I would assume if they added another bone, they would not break backward compatibility with existing animations, or they would wreck every game out there. I dont see anyone complaining about it, so I am assuming it is just my project got messed up somehow (not that suprising the amount of times unity has crashed and forced reimports). I believe new animations I have recently imported work, Im gonna try reimporting the avatars on broken anims and see if it works.
     
  35. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    If that's the case, I'm due a headache as well...
     
  36. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Yep, anyone with any largish game will get it, still happening in unity 2017 beta 1. If you use asset bundles apparently it goes away, I am just waiting for the asset bundle graph tool to mature a bit to try that route again, but it appears that it is not that easy to use for huge projects currently imho. It would be great if it could automatically just build assets from a single scene, but it doesnt appear to work that way.

    Thankfully my anims are fine after a reimport, so only 2 bugs stopping me build right now, this one with the graphical corruption, and another that hangs during building light phase when making a build.
     
  37. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
  38. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Makes you wonder how they managed to build Wasteland 2 - game is enormous. Obviously was made using an older version of Unity as well...
     
  39. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Good point, I guess at that angle everything can be lower res and lower poly.
     
  40. Noss1325

    Noss1325

    Joined:
    Mar 5, 2015
    Posts:
    12
    Thank you all for your replies.

    Not really a fix, but I figured out how to bypass it. It seems I was having too much BIG textures (2K and 4K resolutions).
    So when I did my optimization pass on the scene dividing all textures by 2 or 4, there was no more graphical corruptions.
    Also you must be careful on platforms with limited graphical memory like on consoles (PS4 and XboxOne).

    Good luck all :)
     
    Last edited: Sep 29, 2017
    radiantboy and HakJak like this.
  41. gringan

    gringan

    Joined:
    Oct 27, 2016
    Posts:
    42
    Hi, I m having the same issue, https://postimg.org/image/4m6yzrdk23/

    I need help. I have read about asset bundle, ressources folder, and textures trim. But i m not sure how to start to fix this.

    If i remove from hierarchy the last prefabs i added to my game, i dont have the issue. So maybe its texture limitation problem. How can i be sure ? thanks for helping me.
     
    radiantboy likes this.
  42. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Look at the log file and see if you have any errors.
    Look at the output files in your build and see if any of them are at 4gb(Resources or Scenes).
     
  43. gringan

    gringan

    Joined:
    Oct 27, 2016
    Posts:
    42
  44. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    It does look like you have hit the 4gb limit issue. Try to move some of your assets into AssetBundles:
    https://unity3d.com/learn/tutorials/topics/best-practices/assetbundle-fundamentals
    https://unity3d.com/learn/tutorials/topics/scripting/assetbundles-and-assetbundle-manager
    https://docs.unity3d.com/Manual/AssetBundles-Browser.html
     
  45. gringan

    gringan

    Joined:
    Oct 27, 2016
    Posts:
    42
    Hi.
    I fixed the issue by resizing all the textures that were in 4096 to 2048 .

    https://postimg.org/image/eqt72qcaf/

    It seems working now. I have to check quality in game.

    Thanks.
     
    karl_jones likes this.
  46. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
  47. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Its possible, hard to say from a screenshot. What version of Unity are you using?
    Does the log file have any errors? Are any of your build files near 4gb?
    In Unity 2017.1+ we now fail with an error when the size limit is reached https://issuetracker.unity3d.com/is...ces-dot-load-is-loading-more-than-4gb-of-data
     
    radiantboy likes this.
  48. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    What do you mean you deleted all the textures? Does the textures that are in project folders count too? Like you have 100 textures but in scene they are 50..you use just 50.. does the other 50 counts too that are in the project but not used on some mesh?
     
  49. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Same problem on 32bit?
     
  50. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    What do you mean? You gave up all 4k resolutions on ALL textures ? And made them ex. 1024??? ... im so pissed at Unity right now!! Cant understand that there 2018 now and still not a real fix.. like hello everybody wants 4k
     
    radiantboy likes this.