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 -Rix- · Aug 26, 2014 at 12:45 PM · iosspritesmemory

How can I display big animation without IOS crash?

I have a problem with running animations on IOS - Unity loads up all the sprites linked to script before the scene even starts (no matter if its animation controller, animation or just script with sprites). When it loads all the sprites the IOS crashes cuz of memory - the app is supposed to work on Ipad mini which have 512mb ram (though IOS terminates app when it uses up >=50% of memory). So now - how can I resolve this problem? So for example: How could I run animation with: - 1024x1024 sprites - no compression - 30fps - 60 sprites in total

without IOS crashing? Loading sprites from HDD is too slow...

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by smoggach · Aug 26, 2014 at 01:49 PM

The only way you're going to accomplish this is by using PVR sprites which look absolutely terrible or you'll have to stream your raw images in and out of memory or load the whole thing asynchronously and unload it immediately after it's done (if it will even fit)

I found that I could not stream 1024x768 sprites fast enough with unity code. I managed to get my loading code fast enough to run most animations at 12 fps on any iOS device. I know that natively you can accomplish what you want though. You'll probably have to stream your images in and out of memory with native code. The code i used to load my frames was a WWW file:// request for an image in the StreamingAssets folder. I'd then create a sprite out of the www.textureNonReadable.

Here are a few gotchas that I encountered while building my raw image animation system:

1) Sprite packer tries to decompress and load every single image at the same time. If the amount of memory it takes up exceeds the amount your operating system can handle unity will crash. I think this may have been recently fixed though.

2) The same goes for Resources except it's sneakier. If the raw uncompressed size of all your images in memory exceeds your system's limit Unity will build a corrupt Resources.assets file. I reached this limit with 10000 images or so.

3) Load as much from the disk as you can. Why? Because you can do this asynchronously. Unity's LoadLevelAdditiveAsynch isn't actually asynchronous (the system still chugs). You can also unload it when you're done and have more control over whether it's in memory or not. However you end up with slightly longer loading time. My strategy was to treat all the static images in my scenes like normal sprites and include them in the scenes and load everything else from disk as required. This is also useful for supporting multiple resolutions.

It would be nice if Unity included a feature for us folk who need to stream images from disk and don't believe in PVR.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Some textures don't load on iOS 0 Answers

Memory Allocation Continues to Grow? iOS. 4.6.3 0 Answers

AC-130 Game help 1 Answer

iOS VideoPlayer doesn't unload temp RenderTexture in 2019 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