Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by macpatel · Oct 18, 2016 at 07:41 AM · optimizationandroid buildfile size

Android Build Optimization for Unity - Textures

Hey there,

we are trying to reduce out build size for android. Currently out build size is 26.71MB.

Initially i thought may be its some issue with our textures/images. I created a new Unity project and built it, it's size was 18.4MB :(

Now, i know that unity have many different libs n all , thats why that size, and frankly we will have to leave with that. So, i proceeded to check the texture sizes. I took out editor.log and found this.

 Launched and connected shader compiler UnityShaderCompiler.exe after 0.36 seconds
 Compiled shader 'Standard' (total internal programs: 1176, unique: 532) in 11.07s
 Compiled shader 'Hidden/Internal-PrePassLighting' (total internal programs: 468, unique: 116) in 4.92s
 Compiled shader 'Hidden/Internal-DeferredShading' (total internal programs: 324, unique: 164) in 2.11s
 
 Textures      45.7 mb     88.1% 
 Meshes        0.0 kb     0.0% 
 Animations    9.5 kb     0.0% 
 Sounds        980.1 kb     1.8% 
 Shaders       307.4 kb     0.6% 
 Other Assets  353.5 kb     0.7% 
 Levels        55.8 kb     0.1% 
 Scripts       538.5 kb     1.0% 
 Included DLLs 3.9 mb     7.6% 
 File headers  21.6 kb     0.0% 
 Complete size 51.8 mb     100.0% 
 
 Used Assets and files from the Resources folder, sorted by uncompressed size:
  4.7 mb     9.0% Assets/Sprites/menu_background.png
  3.5 mb     6.8% Assets/Sprites/pattern_1.png
  3.5 mb     6.8% Assets/Sprites/ScreenShots/screenshot_3.png
  3.5 mb     6.8% Assets/Sprites/ScreenShots/screenshot_2.png
  3.5 mb     6.8% Assets/Sprites/ScreenShots/screenshot_1.png
  3.5 mb     6.8% Assets/Splash Screen/splash_bg1.png
  1.3 mb     2.5% Assets/Sprites/fireball/025.png
  934.6 kb     1.8% Assets/Sounds/background.wav
  682.8 kb     1.3% Assets/Sprites/Background_3.png
  636.0 kb     1.2% Assets/Sprites/fireball/021.png
  630.5 kb     1.2% Assets/Sprites/fireball/013.png
  627.2 kb     1.2% Assets/Sprites/fireball/012.png
  626.4 kb     1.2% Assets/Sprites/fireball/022.png.....any many more like this


So it looks like my file " 4.7 mb 9.0% Assets/Sprites/menu_background.png" above is 4.7MB, but the actual file size of that file is just 275KB, why unity is saying 4.7MB ?

Am i missing something ?

-Mahesh

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image macpatel · Oct 18, 2016 at 04:57 PM 0
Share

Any one ?

For the question related to size i found out that you can build two different AP$$anonymous$$s for each architecture and give different version numbers to each of them and upload them to Playstore. This way you can achieve smaller size for your games :)

I have not yet found any answer to texture related question. Any one ?

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by OusedGames · Oct 19, 2016 at 01:53 AM

Go through each imported Texture and Sprite alt text


  • At the bottom you can see the in-game size of your texture 0.8 mb

  • Uncheck "Generate Mip Maps

  • Set Format to "Compressed" - Decrease quality

  • And the bigger your texture the higher will be the size of it

  • Hope it works


help-unity.jpg (84.2 kB)
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image macpatel · Oct 19, 2016 at 04:45 AM 0
Share

Wow! It did work.

Though i am not totally sure why this is working, and why it is a good idea to untick "Generate $$anonymous$$ip $$anonymous$$aps" as there is a lack of documentation or may be this is a normal term for graphic guyz.

avatar image Jessespike macpatel · Oct 19, 2016 at 07:03 PM 0
Share

Generating $$anonymous$$ip $$anonymous$$aps will cause the texture file size to be larger. If you don't need mip maps, such as using sprite, then you can disable it to free up space.

avatar image
0

Answer by Jessespike · Oct 18, 2016 at 06:10 PM

For Android compression (ETC1 and ETC2), textures need their width and height to be a power of 2. In the Texture Importer:

  • Set the "Texture Type" to Advanced and set "Non Power of 2" to Nearest.

  • Disable "Generate Mip Maps" if the textures are never viewed from a distance, such as GUI, splash backgrounds, etc.

  • Set the Format to "Automatic Compression".

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image macpatel · Oct 19, 2016 at 04:10 AM 0
Share

Hey thanks for your answer. I should have mentioned that, It's a 2D game and i am using this images as sprites in the game.

avatar image Jessespike macpatel · Oct 19, 2016 at 07:01 PM 0
Share

That's fine. In the Advanced Type, there's a Sprite $$anonymous$$ode option.

avatar image
0

Answer by Rockaso · May 12, 2018 at 06:57 PM

Hi, I set RGBA Crunched ETC2 and textures (PNGs 2D Texture atlasses made on photoshop) went from 4.0mb~ on final APK build to 100KB and they look good :D

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

does post processing stack work on android and simple depth of field doesnt show in mobile 1 Answer

Texturing - one big one or many small ones? 0 Answers

PNG on iOS? 3 Answers

Despite following Unity best practices, my iOS game bloat from 20MB to 60MB. Why? 1 Answer

Too much assets for mobile game 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges