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
4
Question by extragotcha · Dec 30, 2009 at 05:21 AM · texturegraphicsoptimizationtexture2dasync

How to load a large texture at runtime without blocking the pipeline?

I understand that Apply() is not currently yieldable and I work in visualization where I need to load large textures (1k or 2k) at runtime. The loading is not a problem because WWW will do the job nicely in the background but making a Texture2D out of the data requires to go through Apply() at some point and that will block everything until it's done.

Is there a workaround for this? Can't this process of uploading to the graphics card be yielded/interrupted/fragmented/threaded/anything ?

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
4
Best Answer

Answer by Lucas Meijer 1 · Dec 30, 2009 at 04:59 PM

You can do this with assetbundles. They have a LoadAsync() method, which takes care of all the processor intensive stuff in a background thread, so it won't produce any hickups.

that does require your downloaded data to already be in the assetbundle format though.

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 extragotcha · Dec 31, 2009 at 05:19 AM 0
Share

Lucas, thank you very much for your reply. I wish Texture2D.LoadImage() was "aSyncable"... they obviously can do it so hopefully it's a matter of time. At the moment my only option is to have a Unity editor running and making asset bundles after downloading the large images.

Is there any way to make assetBundles outside the Editor ?

Thanks again.

avatar image Julien-Lynge · Dec 21, 2011 at 06:15 PM 0
Share

A further note: this bottleneck happens regardless of whether you use Apply(), www.texture (which creates a Texture2D from the bytes), or www.LoadImageIntoTexture(). Alas, it appears we're two years down the road and no real improvement in this regard. The freeze on my fairly high-end machine is around 40-50 ms per megapixel loaded. We're trying to do a progressive disclosure / map tiling and it's definitely noticeable. Has anyone found any workarounds other than assetBundles in the Unity 3 series?

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

1 Person is following this question.

avatar image

Related Questions

What are possible causes and solutions to randomly garbled textures on standalone builds? 1 Answer

Is a texture visible 1 Answer

Changing color of texture with transparency efficiently 0 Answers

Can wheel textures be seperate from car-body texture? 1 Answer

Texture and Texture2D for GUI (simple question) 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