• 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
-1
Question by LuisCRSousa · Oct 27, 2014 at 04:31 PM · texturewww

Change TextureType of an downloaded texture

Hi!

Is there a way to change the TextureType of a downloaded Texture to Image/Texture (default is GUI)?

Its easy doing that on a texture imported on the resource folder.. But with an downloaded texture?

Please help

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 smoggach · Oct 27, 2014 at 05:07 PM 0
Share

You may be looking for this:

http://docs.unity3d.com/ScriptReference/WWW.LoadImageIntoTexture.html

TextureType doesn't do much more than tell Unity how to create the texture object, which you can do yourself at runtime when creating a new texture object.

avatar image LuisCRSousa · Oct 27, 2014 at 05:20 PM 0
Share

I am using that. $$anonymous$$y problem is not download the image and associate to an object texture. $$anonymous$$y problem is changing the textureType.

How can i change at runtime? TextureType changes everything..

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by smoggach · Oct 27, 2014 at 05:27 PM

No. There is no reason to either. Textures do not have Texture Types. TextureImporters have Texture Types which do nothing more than tell Unity how to package the image.

If you really want to set your texturetype then you will have to put the asset into an asset bundle, download the bundle, then load the texture from it.

Comment
Add comment · Show 4 · 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 LuisCRSousa · Oct 27, 2014 at 05:34 PM 0
Share

So how do you explain this? The image on the left is with texture type set to texture. The image on the right is with texture type set to GUI.

alt text

sem nome.png (2.3 kB)
avatar image smoggach · Oct 27, 2014 at 05:45 PM 0
Share

I'll bet the image on the left has different texture properties than the image on the right. Right image looks like 16-bit truecolor and the image on the left looks like a mipmap. All of these are things you can set when creating a texture at runtime.

When you send your WWW call, unity isn't creating any textures until you try to get them from the WWW. You're not downloading a unity asset, you are downloading a file containing image information. When you set the texture type in the editor, you are telling unity what parameters to pass into this function http://docs.unity3d.com/ScriptReference/Texture2D-ctor.html

When you download the image from the internet, you must do it yourself.

avatar image LuisCRSousa · Oct 27, 2014 at 07:36 PM 0
Share

The only difference is the Texture Type, nothing else. The image is already on resource folder. I change texture type, apply changes and this is what is made.

I can change texture format, but the problem that i have is texture type. When i download a texture i can´t change it.. Not even with OnPostprocessTexture function. That function is only with textures added manualy.

I think i have to use asset bundles..

avatar image smoggach · Oct 27, 2014 at 07:38 PM 1
Share

i give up.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Load an image from www and save it for offline use 0 Answers

Assigning UV Map to model at runtime 0 Answers

Loading Pictures from Android Device into game at runtime 1 Answer

How can I load pre-compressed textures at run-time (without using assetBundles) 3 Answers

Best way to determine WWW timeout/404/etc.? 2 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