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 SuperProgrammer · Aug 03, 2012 at 08:00 AM · crashruntimeloadingmemoryjpg

Load image in runtime from jpg

If i load image to unity from jpg or png files. Image consumes great memory. And after 1.2-1.3 GB memory usage(not total ie usage) web player crashing(The content was stopped because a fatal content error has been detected).

Converting image to DXT1 not effective and as i learn compress in runtime almost not possible(Texture2D.compress too).

A 4096x4096 texture killing ~80-100MB system memory(load from jpg and no alpha also converted to DXT1).

Only way load from AssetBundle? And Why ~1.2 GB memory usage a limit for web application? Sure if there is no way to load image from jpg with low memory usage, i will look for alternative ways. But why memory usage have a limit or crash? (My total system memory big enough for more and using 64 bit system)

Comment
Add comment · Show 3
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 ScroodgeM · Aug 03, 2012 at 08:04 AM 0
Share

Texture2D tex = new Texture2D(4096, 4096, TextureFormat.RGB24, false);
www.LoadImageIntoTexture(tex);

try to load images in this way. it should takes exactly 48$$anonymous$$B per texture,

avatar image ScroodgeM · Aug 03, 2012 at 08:09 AM 0
Share

also:

  • try this case in different browsers

  • try this case in standalone appilcation with same web loading

avatar image SuperProgrammer · Aug 03, 2012 at 11:54 AM 0
Share

more bad 3 texture and reached ~0.5 GB. ~120 $$anonymous$$B per texture. again same result ~1.2 GB crashing. Standalone appilcation not crashed but using huge memory (same rate). Need working on ie too. Without ie not useful.

Yeah i dont know how it taking 2x more memory then our expect. I am used www.Dispose() too. i think only material texture using that size, no leak in code.

Converting DXT externally and download will save memory usage but it will req lots download size. (tested with DDS file it consumed ~10 $$anonymous$$B)

Use asset bundle / download in zip or rar file (for reduce size) are only ways i think. $$anonymous$$aybe i should ask for how to open zip/rar file? Or any suggestion about free file sharing site? (with direct download link) or DDS photo sharing site lol :D

I think my web application will req lots bantwidth because of images :D or maybe i should put images in build.

I wanted to download and assign textures in time. And fast loading for use. i could add low res textures until that high res images loading. But no way to load 18x 4096x4096 textures.

2 $$anonymous$$B jpg file consu$$anonymous$$g 120 $$anonymous$$B ram perfect :S I am sure a jpg file shouldnt consume lots memory like that. Something must be wrong.

1 Reply

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

Answer by ScroodgeM · Aug 03, 2012 at 04:24 PM

create an asset bundle (-s) with a textures imported by Unity and load them in bundles

http://docs.unity3d.com/Documentation/ScriptReference/AssetBundle.html

this should not use any additional converting/unpacking in runtime and store it packed.

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

8 People are following this question.

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

Related Questions

OutOfMemoryException: Out of memory 3 Answers

RI.Hid Is Driving Me Insane 1 Answer

Several Memory Optimization Questions 0 Answers

Out of memory related to ProBuilder 2 Answers

Large memory footprint increase when assigning a GUITexture from a WWW Object on iPad 1 Answer


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