• 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 /
  • Help Room /
avatar image
0
Question by SKNKanimation · Feb 26, 2017 at 01:22 PM · texturevrwww.texturetexture compressionwww.loadimageintotexture

Loading a user-edited texture at runtime without a brief freeze

I am very troubled! I am trying to implement an update to my game that allows my users to edit the textures on the characters easily, but there don't seem to be any ways to do it without causing a brief stall of the game. I'm hoping someone can help. I've tried so many things and none of them seem to work properly.

Use situation: the user presses a button to change a 2048x2048 texture on a character. I have around 130 different textures that are possible to load. The game is made with Unity 5.5.1

Problem: The textures for these characters are not user-accessible to be edited in a graphics editor unless they are stored as PNG or JPEG, which requires www.texture or www.loadimageintotexture to take them from where the user has them and put them in the game. Those functions freeze the game for a moment, though, so they're no good for a VR game.

What doesn't work: www.loadimageintotexture performs the task itself fine, but it causes the game to freeze for a moment so I can't use it.

Loading a compressed Texture file with Resources.loadasync or similar technique works fine for the textures, but the files are not accessible to the user because they're inside those .asset files. Editing a DXT5 texture with Gimp or Photoshop isn't really user friendly, either, even if the users could get into that file. They really need to be PNGs or JPEGs.

What I think I want: I can think of two things would probably solve this problem, but I'm afraid I don't know how to do either of them.

Way 1: Perform the task that www.loadimageintotexture does on a different thread, somehow. Decompressing a JPG/PNG and generating mip maps is too computationally heavy to do on the main thread, but if I could do it in the background it would work just fine.

Way 2: Load all the textures at startup using www, and then save them in a "Ready to go" DXT5 format like they would be in the Resources folder, or save them all as an asset bundle. That way all I would need to do is load them as I would a texture from an asset bundle/resources folder. I could ask the user if he or she changed the textures at startup, and then rebuild the assetbundle if the answer is yes.

Can either of those be done? Perhaps there's another way?

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

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

125 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Blurry textures in Gear VR 1 Answer

DownloadTexture not working in iOS devices 1 Answer

How to import .blend file without loosing texture quality? 0 Answers

Resizing a texture from internet 0 Answers

Map video texture to a half sphere in Unity 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