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 citiral · Apr 11, 2012 at 01:38 PM · guitexturespriteswwwquality

WWW texture quality

Hello everyone,

I am making an isometric game with sprites. I decided to make the textures be loaded from the HDD at startup, so people can make their own textures, and it makes it easier to see of new textures are good looking.

I already implemented the possibility to load textures from the HDD, but whenever I load a texture, it is heavily compressed and looks really ugly, cropped, and streched out when using it in a GUI.DrawTexture.

So my question is, how can I change the texturetype when loading a texture from a WWW call? (GUI texture format, point filter mode, 4096 max size and truecolor format to be precise)

Thanks in advance.

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 GuyTidhar · Apr 11, 2012 at 02:07 PM 0
Share

When you create the 2D texture into which you wish to download the texture, what parameters did you give it?

For instance: new Texture2D(4096, 4096, TextureFormat.DXT1, false); ???

What file type for the textures are you using?

avatar image citiral · Apr 11, 2012 at 02:19 PM 0
Share

I just initialized an array: var texturearr : Texture2D[];

and loaded the textures in like this:

 var www : WWW = new WWW ("file://" + Application.dataPath + "/isometric UV2.png");
 yield www;
 texturearr[0] = www.texture;
 www = new WWW ("file://" + Application.dataPath + "/isometric UV2blocked.png");
 yield www;
 texturearr[1] = www.texture;

2 Replies

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

Answer by GuyTidhar · Apr 11, 2012 at 02:20 PM

Please use this: http://unity3d.com/support/documentation/ScriptReference/WWW.LoadImageIntoTexture.html

For instance. in your case you could do:

 var textures : Texture2D[];
 var textureNames : String[] = [ "/isometric UV2.png", "/isometric UV2blocked.png" ];

 function Start()
 {
     StartCoroutine(DownloadTextures());
 }
 
 function DownloadTextures()
 {
    textures = new Texture2D[textureNames.Length];
    
    for(var t=0; t<textureNames.Length; t++)
    {
        textures[t] = new Texture2D(4096, 4096, TextureFormat.DXT1, false);

        // Start a download of the given URL
        var www = new WWW("file://" + Application.dataPath + textureNames[t]);

        // wait until the download is done
        yield www;

        // assign the downloaded image to the main texture of the object
        www.LoadImageIntoTexture(textures[t]);
    }
 }


Now you can just add texture string names for each texture you wish.

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 citiral · Apr 11, 2012 at 02:47 PM 0
Share

That still made it be strechted, but I got it to work by just adding

 texturearr[0].anisoLevel = 0;
 texturearr[0].filter$$anonymous$$ode = Filter$$anonymous$$ode.Point;

I can't believe it was that simple. Thanks, I woudln't have found it if you didn't suggest:

   textures[t] = new Texture2D(4096, 4096, TextureFormat.DXT1, false);

I am forever grateful!

avatar image GuyTidhar · Apr 11, 2012 at 04:42 PM 0
Share

You are very welcome mate :)

avatar image
0

Answer by networm · Apr 04, 2020 at 02:17 AM

If Texture2D enabled mipChain then the resolution of texture would be affected by QualitySettings.masterTextureLimit.

  • Unity - Scripting API: QualitySettings.masterTextureLimit

The key is that WWW.texture enabled mipChain when construct Texture2D. So you need to construct a Texture2D which disabled mipChain manually and use WWW.LoadImageIntoTexture to load texture.

  • Unity - Scripting API: Texture2D.Texture2D

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

6 People are following this question.

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

Related Questions

www.texture textureType to GUI 0 Answers

How to improve the texture quality in Unity ? 1 Answer

Texture quality and quality settings 1 Answer

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

Screenshot PNG to GUITexture (NONE Texture) 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