Search Unity

A key focus area for Unity 2021.1, now available in beta, is Editor performance, helping you iterate faster on your project. Texture import and compression optimization is a key part of this.

Compared to other game assets, textures typically take up the majority of hard disk space – and approximately two thirds of the total import time. When working on a complex project, waiting for textures to import or compress costs you valuable time. While Unity tools for teams, such as Unity Accelerator, help alleviate this issue, we know that we can always do more. That’s why we’ve started working on optimizing the texture import and compression process. 

The timing below reflects a project on a PC with AMD ThreadRipper 1950X CPU with the project folder on an SSD disk. Speedups on other configurations (e.g., Mac) are similar. We are comparing an earlier version of Unity 2020.2 (alpha 21) with the Unity 2021.1 beta 5 version.

Here’s how long it takes to import all textures from the Boat Attack project (118 textures, 720MB):

  • PC platform: 102 → 94 seconds (1.1x speedup)
  • Android platform, ETC2 compression: 203 → 101 seconds (2.0x speedup)
  • Android platform, ASTC compression: 536 → 172 seconds (3.1x speedup)
  • PC platform, same texture size settings as Android: 30 → 22 seconds (1.4x speedup) Many textures in the project use larger texture sizes on PC compared to on the Android platform.

On a larger project, such as Book of the Dead: Environment, importing all the textures (425 textures, 1.9 GB) takes:

  • PC platform: 161 → 133 seconds (1.2x speedup)
  • Android platform, ETC2 compression: 1140 → 494 seconds (2.3x speedup)
  • Android platform, ASTC compression: 3162 → 1204 seconds (2.6x speedup)

We achieved these speedups by focusing on optimizing the following two areas:
1) pixel data conversions and copies done during the texture import process, as well as adding SIMD or threading optimizations to the slow parts (e.g., sRGB conversion, panoramic layout cubemap processing, etc.)
2) texture compression, by updating to the latest versions of compression libraries or optimizing the compression libraries themselves

Low-risk parts of the ETC format compression optimizations (1.4x speedup) are already backported to 2020.2.0, 2020.1.15 and 2019.4.16 versions.

What’s next

Further improvements to texture import times and compression are coming for Unity 2021.2, so keep an eye out for the next public release on our beta testing page and beta forums

Unity 2021.1 beta

We hope this helps and that as a Unity 2021.1 user, you’ll spend way less time waiting for import progress bars to finish. You can get the latest beta from the Unity Hub or on our download page. As of today, it includes over 1,900 fixes and more than 260 features and changes. Try it out, and if you run into any issues, submit a bug report to qualify for your chance to win one of four ultrawide IPS 34” 144 Hz monitors (see the full rules here). Remember, the beta is not intended for use in production-stage projects. You should always make sure to back up your existing projects if you plan to use them with the beta.

That being said, we would love to know if you experience similar texture import time improvements in Unity 2021.1. Tell us what you think in this forum thread.

25 replies on “Texture optimization in Unity 2021.1”

This is great! Unrelated request, but that would be a great improvement: being able to run Texture2D.Compress (or something similar) on a separate thread. Improvements on mesh manipulations a couple years back were great news. Being able to compress textures at runtime without spikes would be awesome!

Would it be possible to move texture importing to a background process?
Most of the time we do not need (the full resolution version of) most textures immediately after dragging them into the project folder or after updating our Unity version (or anything else that triggers an asset reimport).

So ideally Unity should only create a placeholder texture which can already be used (applied to a Material) but which gets replaced with higher and higher resolution versions as it continues being imported in the background. With mipmapping enabled the lower resolution versions could even be reused (I think).
And to finish it off, add a new EdiorWindow which shows a reorderable list of texture-import tasks so that *when* a specific texture if required faster it can be moved to the top of the priority list.

Please fix the bad global illumination and verify the realtime global illumination.
Can we use deferred renderer in urp on upcoming unity version?

Performance improvements in the editor are always welcome. Great job Aras, Florian, and anyone else involved. I would love to see more blog posts like this. Thank you!

Very nice improvements! Thanks

Any news about only compressing the textures that are used in the build at build time?
and not all the textures in the project folder?

You may want to see how the compression (crunch) affect the graphics while in editor. How much space it takes etc.

Well it could be configurable / on-demand. Although the editor isn’t comparable to the runtime in many ways already.

really nice but… what’s the value of importing textures faster if Book of the Dead: Environment doesn’t work since 2018 versions?

Comments are closed.