Search code examples
c#androidunity-game-enginegoogle-cardboard

Unity building too large cubemaps


I am using Unity 5.3.5 and am trying to implement 6 skyboxes in my project. Each skybox is at most 3mb in size but when i build my project, the app size becomes 87mb! I tried looking into details and found that each skybox converted to cubemap has been sized to 16mb(14.2%). This I saw found out from editor.log in

%localappdata%\Unity\Editor

I tried searching for this issue but found that this has been a known bug in Unity 4+. I need to decrease my app size! What should I do?


Solution

  • This is a known issue with Cubemaps. This problem may arise due to several reasons. Here are a few ways to tweak your cubemaps in order to reduce file size:

    1. Click on your cubemap and in the inspector, check if Format is set to Compressed
    2. The default Max Size is set to 2048 (4K). If your project does not require that size, try reducing to 1024 or less(if possible)
    3. Check the resolution of your images that you use to build your cubemaps
    4. This link http://forum.unity3d.com/threads/has-the-cubemap-texture-compression-bug-been-fixed-in-unity4.165125/ talks about cubemap compression but it is most likely that you will face run-time memory leaks.

    I have successfully reduced my build sizes in the past. Hope these tips help you as well.