Search Unity

  1. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  2. Unity 2017.1 is now released.
    Dismiss Notice
  3. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  4. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

Texture Compression Times Really Slow (ETC1/2)

Discussion in 'Android' started by LilBitStudio, Apr 8, 2015.

  1. LilBitStudio

    LilBitStudio

    Joined:
    Dec 13, 2012
    Posts:
    24
    Is anyone experiencing excruciatingly slow texture compression times for ETC1/ETC2?

    I'm on Unity 5 with patch 0p3 now. Compression on the Android side used to be really quite fast (way faster than my pvrtc compressions on iOS), but now the times are much slower. It appears pvrtextool is running single threaded and its taking a 2048 texture over 30 minutes to compress on best quality (on a 3.4Ghz i7 5K iMac and longer on my older '08 Mac Pro).

    Any suggestions or ideas whats going on considering how significantly longer its become? Scott
     
    zakirshikhli likes this.
  2. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    601
    Doesn't it use etctool or something like that?
     
  3. LilBitStudio

    LilBitStudio

    Joined:
    Dec 13, 2012
    Posts:
    24
    To be honest I can't recall ever checking until now but I was surprised to see pvrtextool being launched for each texture in the import process. I had to even check to make sure that it even supported etc compression, but according to their website; it does.

    So I'm not sure if something is falling back to pvrtextool, this is a recent change, or what. I just know so far that the performance is incredibly bad. Scott
     
  4. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    601
    Maybe it's because you are running on MacOS. I'm in Unity 4.6 right now on Windows 8.1, and it pops up an ETC tool exe. So maybe I'm not the best help, but maybe it's something changed for Unity 5, or because it's using pvrtextool on a Mac.

    I'm sure if it was taking everyone 30min there would be a lot more complaining going on though!!
     
  5. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    174
    I just checked: we switched from etcpack to PVRTexTool in Unity 5. Compression Quality 'Best' is now super slow for ETC. The result should be of higher quality now but I think it's just too slow.
     
    image28 and MattijsKneppers like this.
  6. agepbiz

    agepbiz

    Joined:
    Apr 15, 2013
    Posts:
    2
    This was the case for Unity 4 also. Superslow compression on my ETC2 textures. I really hate updating the textures now. But ETC2 gives very nice result on my Android app I am working on. Unity with the PVRTexTool running as a process spent over 24 hours on converting my project from Unity 4 to Unity 5

    I am on PC
     
    Last edited: Apr 10, 2015
  7. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    I did contact Imagination Technologies and this is what they said
    "Unfortunately PVRTexTool doesn't have multithreaded ETC1 compression capability. It's a good suggestion and we will be investigating it for a future release."

    so only options for now are:
    * Use different tool
    or
    * Make Unity do threaded texture importing, when multiple textures are imported
     
  8. agepbiz

    agepbiz

    Joined:
    Apr 15, 2013
    Posts:
    2
    Setting compression quality to normal takes just a couple of minutes on a 4K texture, but setting it to best takes over an hour.. strange
     
  9. Simon-F

    Simon-F

    Joined:
    Jan 17, 2011
    Posts:
    36
    If it's based on the standard ETC compression code that Strom et al released, then, IIRC, there are three quality settings Fast, Medium, & Slow, and (according to their code) the latter two increase the search space relative to Fast by factors of around 27x and 125x respectively. They might also try test other modes which may increase the search time further.
     
  10. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    491
    I just installed Unity 5.0.1f1

    Setting GLES 2.0 or GLES 3.0 compression on the Android build for example, a unitypackage import can take 30 mins per PNG / EXR file, absolutely killing development.

    Any tips on how this can be improved, avoided? Do I only set compression at night before I go to sleep and process 8-10 pngs per day? =/
     
  11. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    59
    Unity's PRVTexTool is still taking forever to compress.
    I did a non-unity project on iOS a few years ago and PRVTexTool was much faster.
     
  12. LilBitStudio

    LilBitStudio

    Joined:
    Dec 13, 2012
    Posts:
    24
    I know this doesn't help make the compression times run faster but figured I'd share what I do.

    1) installed asset server cache
    2) turned off "compress assets on import" in Unity preferences
    3) I also installed Unity on a second machine configured to share the same instance of the asset server cache but left the compress preference on.

    When updating images or modifying atlases, the compression gets skipped -- until a build is performed making development quicker. To help cut down build times, I periodically will do one of two things:

    1) when shutting down for the night, I'll turn on "compress assets on import" and let it run over night. The compressed textures will be updated in the cache for later.

    or

    2) I'll load the project up on my second machine letting me continue working while it compresses and updates the textures in the shared cache.

    This is obviously for builds when I'm not using Unity's cloud build. It's not perfect but it at least keeps me from wanting to run in traffic :) Scott
     
    Aranda likes this.
  13. CG_Echtzeitschmiede

    CG_Echtzeitschmiede

    Joined:
    Feb 19, 2015
    Posts:
    90
    I'm sorry, but it's unacceptable how this slow conversion process is single threaded. 15 hours ago I opened my Unity 4 project for the first time in Unity 5. I still don't have it open because it's still importing textures and only about 70% done. My task manager consistenly reads 8% CPU usage. Big fat waste of time, this is really annoying. It can't be that hard to launch multiple threads.

    Is there at least a way to do this conversion in a multi threaded manner via some script?
     
  14. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    174
    ETC compression will be multithreaded in Unity 5.2. I'll check if a backport to 5.1 is feasible.
    But even in multithreaded mode 'Best' compression quality will still be much slower than 'Normal'.
    In Unity 4.6 'Best' was just mapped to 'Normal'.
     
  15. CG_Echtzeitschmiede

    CG_Echtzeitschmiede

    Joined:
    Feb 19, 2015
    Posts:
    90
    That is great news, thank you in advance!
     
  16. fpilote

    fpilote

    Joined:
    Jul 19, 2013
    Posts:
    5
    Hey florian, i just looked at 5.2 changelog and i couldn't find anything about multithreaded ETC compression.

    Was it moved to a 5.2.x or later release?

    Thanks
     
  17. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    63
    5.2.0 does have multi-threaded PVRTexTool. You can see that in your process monitor when compressing job is running.

    pvrtextool.PNG
     
    Last edited: Sep 11, 2015
  18. Madhotdog

    Madhotdog

    Joined:
    Sep 1, 2013
    Posts:
    4
    The import does still seem to be incredibly slow compared to how it used to be. It only says ~1 sec on Normal, and up to 20 mins for best on a 2k texture using a quad core processor .
     
    Last edited: Dec 4, 2015
  19. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    63
    Well, PVRTexTool is a 3rd party software so I don't think you should address that to UT.
     
  20. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    733
    Is there any way to map "Best" back to "normal" quality for compression, it takes almost an hour to convert my project from 5.3 beta to 5.3 release... it reimported everything! which would be fine if i could find out which of those textures are not set to normal, without having to stare at the screen and write them all down =/
     
    joaobsneto likes this.
  21. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,081
    this tool is killing me.... still.
     
  22. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    63
    If you have only POT textures2D, then you can choose "Texture" type in Project window search bar, select all found assets, select Texture 2D in Inspector and set compression to Normal, this will set it to normal for all of them.
    This won't work though if any of them is non-POT.

    Oh, I forgot to mention that your textures should be of advanced type for compression option to show for all them selected.
     
  23. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    733
    Hi TimGS, some are advanced, some are not, some are True Color, some are compressed, some are POT, some are not.
     
  24. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    63
    Manual routine then. :(
     
  25. zakirshikhli

    zakirshikhli

    Joined:
    Apr 8, 2016
    Posts:
    10
    yes , PVRTexTool.exe
     
  26. goehler

    goehler

    Joined:
    Sep 20, 2016
    Posts:
    1
    This is killing me! I don't even wanna think about how slow this must have been before multithreading..
    Any update on how to speed this up, or set quality to normal??
     
  27. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    257
  28. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    651
    It's been hours crunching textures, and it's still at 15%!

    God, I only selected 10 textures with the Best setting. Is the difference perceivable and worth it?

    I believe this is going to take about 24 hours, and there's one PVRTexTool active for each processor on my machine.

    I killed the unity process but now I'm stuck on relaunch, it's importing everything in ETC1+alpha Best Quality.

    I'd like to try to kill the processes but... what if I had to start over?

    Isn't there a way to cancel the conversion process without doing a complete rollback of the project or deleting the pictures?
     
  29. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    733
    I had to go through every single texture and set its quality to Normal, instead of Best, that took a long time. Apparently at some point "Best" wasn't actually doing anything and it was instead falling through to "Normal" behind the scenes. Then they made Best work and it increased import by hours. There is no quick solution at the moment. And i couldnt even tell you if the quality is worth the wait.
     
  30. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    63
    It's definitely worth it in case of lightmaps. Everything else — its a waste of time imo.
     
  31. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    339
    I'm experiencing this in Unity 2017 android- I innocently applied 'best' quality to a 2k texture, thinking maybe it would take 2-4 times the usual time, but now 35mins later I'm still waiting.... There should at the very least be a 'Cancel' button so you can stop this and get on with your work. Also I am guessing when you upgrade Unity, or switch platforms this will happen all over again, which if you have set even a few textures to 'Best' could mean it will be an 'over night' job as opposed to an 'over lunch' job. I STRONGLY feel that Unity needs to do something to make 'Best' a) cancel-able and b) optional when you are switching platforms or opening a project after updating- this crap could easily cost you a day of work time if you or someone else had set 20 or so textures to 'best' without realizing the consequences...
     
  32. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    339
    Haha, and while I was typing that it just finished, and made virtually zero difference as far as I can see!