Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 TheGeoff · Sep 27, 2012 at 07:18 PM · iostexturememory

Image size correlation between disk and memory

We've been working to reduce the memory footprint of our iOS game. We discovered the worst offenders were 3 2D images we were using as background textures. We've dealt with them by loading/unloading as necessary.

But we are puzzled at how the size of the graphic on disk correlates to the memory it takes in-game. For instance, for images 1, 2, and 3, the png sizes were ~900k, ~800k and ~170k, however during runtime they consumed, 8 mb, 8mb and 10mb. Since png's are compressed we decided to save them as BMPs to see if the uncompressed sizes correlated more closely, but they came out at around 2mb. Still far off from the 8-10mb sizes we were seeing.

I know we can use smaller images, texture compression, etc, to solve the issue, but we'd like to know a little more about what causes the images to consume so much more memory during runtime. Does anybody know anything about this? We are assuming the textures are completely uncompressed are runtime but wanted to know if there are any other factors.

Thanks, Geoff

Comment
Add comment · Show 2
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 Bunny83 · Sep 27, 2012 at 07:26 PM 0
Share

Well, do you use mipmaps? this would effectively add 1/3 of the size. Are they stored as power-of-two? $$anonymous$$eep in $$anonymous$$d that the asset format you put into Unity is not the format used in a build. Check the build log file for more details. Just restart Unity (to clear the editor log), create a build of your game, open the console window (in unity) and press the "open editor log" button at the top right.

It usually gives you a quite detailed list of asset ordered by size. iOS also has a special image / texture format. I never developed for iOS yet, so i can't tell much about it ;)

avatar image TheGeoff · Sep 28, 2012 at 07:31 PM 0
Share

No $$anonymous$$IP $$anonymous$$aps.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by TheGeoff · Sep 28, 2012 at 07:49 PM

I found an interesting Post on StackOverflow that really helped us figure out what's going on, StackOverflow.com

We also experimented around quite a bit with the various compression choices we had for iOS. PVRTC 4 bit for for RGB and RGBA worked very well for most items. The compression was good and the quality is much more acceptable than the more generic ones we tried. The PowerVR chip in iDevices is made to work with this format so it makes total sense. Though for things like Atlases for UI graphics and text, it did not work well at all. Luckily those weren't using all that much memory to start with. We ended up using either RGBA 32 bit in the iPhone Override tab or just falling back to True Color on the default tab for things that just didn't work well with any sort of compression (like Font atlases).

The long and short of it is, there's a lot more going on than meets the eye. Uncompressed, is really uncompressed when it comes to run time. Experiment with your compression options and see what works better for your particular case, texture, platform, etc. Texture Type: Advanced is your friend.

Comment
Add comment · Show 1 · 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 Bunny83 · Sep 29, 2012 at 01:08 AM 0
Share

It still doesn't explain the huge difference. As you said your uncompressed 24 bit images (bmp) are just 2 $$anonymous$$B.

Anyway i'm glad you fould at least a solution ;)

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

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

AssetBundle.Unload(False) in IOS Save Reference ? 0 Answers

Does Unity load in memory textures that are target of public variables ? (iOS) 1 Answer

Unexpected memory overhead of textures on iOS 0 Answers

Can I load textures at runtime with a smaller memory footprint? 1 Answer

Textures/Atlases and memory management 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