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 /
This question was closed Jun 24, 2015 at 01:08 PM by fafase for the following reason:

The question is answered, right answer was accepted

avatar image
1
Question by fafase · Jun 23, 2015 at 11:43 AM · textureunity5

Issue with texture loading

Basic script:

 public class Loading : MonoBehaviour {
     public GameObject plane;
     string []    str = { "http://users.metropolia.fi/~lucasc/texture_1a_by_jakezdaniel-d1b6lmo.jpg",    
         "http://users.metropolia.fi/~lucasc/texture_34_by_sirius_sdz-d1ihrrm.jpg",
         "http://users.metropolia.fi/~lucasc/a1ca03e0ca1cda6ae5ea0e873318a306349c0934.jpg",
         "http://users.metropolia.fi/~lucasc/a34290b07559b4e3881f816fe97a3d02f4f2232b.jpg"
     }; 
     int index = 0;
     void Update(){
         if(Input.GetKeyDown(KeyCode.Space)) {
             StartCoroutine (StartRoutine());
         }
     }
     IEnumerator StartRoutine () {
         WWW wwwTexture = new WWW(str[index]);
         yield return wwwTexture;
         if(++index == str.Length) { index = 0; }
         MeshRenderer meshRenderer = plane.GetComponent<MeshRenderer>();
         meshRenderer.material.mainTexture = wwwTexture.texture;
     }
 }

Using this with a basic cube on scene (nothing else, just drag the cube into the plane slot), then the first two textures loads fine but the third and fourth just keeps coming up with problem. The actual texture gets offset to 0.3 and the remaining 0.6 is filled with either some other textures or some distorsion. Funny it does not happen on all textures.

I guess it might have to do with the nature of those. I filled a bug report but maybe someone has a solution as we would need a quick solution or explanation.

Expected: alt text

What I get:

alt text

See the extra purple thingy that should not be there? This problem came up with Unity5 and was working fine on Unity4.

a1ca03e0ca1cda6ae5ea0e873318a306349c0934.jpg (4.3 kB)
screen-shot-2015-06-23-at-143914.png (92.8 kB)
Comment
Add comment · Show 4
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 Dave-Carlile · Jun 23, 2015 at 05:34 PM 0
Share

As a test, what if you load the 4 textures as Resources ins$$anonymous$$d of web, leaving everything else the same. Do you get the same behavior then? If not that would indicate a problem with WWW, otherwise maybe something changed with how the Plane is dealing with materials?

avatar image Paulo-Henrique025 · Jun 23, 2015 at 05:59 PM 0
Share

print the www.error also try to put the texture obtained in a GuiLayout.Label to check if it is co$$anonymous$$g correctly.

avatar image fafase · Jun 23, 2015 at 06:59 PM 0
Share

So if i assign the texture manually to a material, no issue. If i use File.ReadAllBytes and create the texture, same issue.

I tried assigning it to plane, quad, cube and a custom plane and all fails. Quad goes even crazier duplicating the texture within the texture.

The unity dev $$anonymous$$m is meant to be working on right now but i guess i am kot their only bug, so it may take time for a fix.

I realise this is actually a duplicate for this http://answers.unity3d.com/questions/257080/www-loading-texture-problem-when-built.html i found another older similar issue esrlier from the forum but i cant get it back. It had no solution either.

It seems the issue would come from the main texture assignment line as if assign manually, works, if done by code,breaks.

avatar image fafase · Jun 24, 2015 at 06:01 AM 0
Share

I also tried with SetTexture in case but nope, still there. And www.error is null.

I guess it has to do with the nature of the texture which is some kind of mask.

1 Reply

  • Sort: 
avatar image
2
Best Answer

Answer by fafase · Jun 24, 2015 at 01:08 PM

It seems to have been fixed in yesterday's patch (23/06/2015):

http://issuetracker.unity3d.com/issues/image-isnt-displayed-correctly-when-using-new-www-url-to-load-a-single-color-channel-jpg-file

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

Follow this Question

Answers Answers and Comments

23 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

Related Questions

texture resolutions in Unity 5 0 Answers

Unity5 build issue, not showing texture. 1 Answer

Terrain Tree Height not working on Unity 5.3.4f1 0 Answers

Assigning UV Map to model at runtime 0 Answers

MTLTextureDescriptor has invalid pixelFormat (0). while building a project in Xcode. 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