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
1
Question by Wibbs 1 · Mar 16, 2011 at 01:28 PM · texture2dwwwtransparency

Transparency showing as black - textures and images loaded using www

Hi,

I am using the WWW class to load some .png images as textures, which I then apply to programmatically generated meshes. I am setting the texture of the mesh using the game object's MeshRenderer, and I know this is working to a point as the mesh displays the texture, just with transparency as black:

gameObject.GetComponent.<MeshRenderer>().material.mainTexture = texture;

I have a feeling the problem has something to do with the way I'm setting the material up, but I don't know what it is I might be doing wrong.

Any pointers as to why transparency isn't displaying properly would be appreciated.

Thanks,

Wibbs

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

4 Replies

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

Answer by efge · Mar 16, 2011 at 01:42 PM

Maybe it's because you have a standard shader apllied?
You could try to use a simple Transparent/Diffuse shader as the default shader for your object.

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 Wibbs 1 · Mar 16, 2011 at 01:49 PM 0
Share

Thanks for the quick reply - it worked :) Never even thought of shaders affecting it

avatar image madhu131313 · Apr 03, 2015 at 06:08 AM 0
Share

$$anonymous$$y gameobject too has a Diffuse, but still it's black texture. Can you please check $$anonymous$$e here http://answers.unity3d.com/questions/936602/image-loaded-is-not-getting-displayed.html

avatar image
0

Answer by Anton1274 · Dec 15, 2014 at 05:42 PM

I've the same problem using Unity 5 beta.. This is my code:- var www = new WWW("http://www.tonypec1974.altervista.org/snap_1.jpg"); // wait until the download is done yield www; // assign the downloaded image to the main texture of the object www.LoadImageIntoTexture(GetComponent.().material.mainTexture);

it shows only black texture Transparent/Diffuse shader doesn't work for me

03/04/2015. I've solved the issue, isn't unity problem is a server problem. Some server use a service named Cloufire. This service for speed reason keep in memory old image uploaded on the server without updating. Deactivate Cloudfire on the server will fix the problem.

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 madhu131313 · Apr 03, 2015 at 06:07 AM 0
Share

$$anonymous$$y gameobject too has a Diffuse, but still it's black texture. have you solved your issue. please check $$anonymous$$e here http://answers.unity3d.com/questions/936602/image-loaded-is-not-getting-displayed.html

avatar image Anton1274 · Apr 03, 2015 at 10:38 AM 0
Share

03/04/2015. I've solved the issue, isn't unity problem is a server problem. Some server use a service named Cloufire. This service for speed reason keep in memory old image uploaded on the server without updating. Deactivate Cloudfire on the server will fix the problem.

avatar image
0

Answer by sumitbabucutevil · Nov 27, 2020 at 06:11 AM

you need to be using texture.EncodeToPNG(); very importnat

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

Answer by darthmodulus_unity · Jun 20, 2021 at 09:27 AM

I know this is an old post. But, I happened across it and decided to place an answer since as of June 19, 2021, the answer to this could also be the following:

Check your Material's option for Rendering Mode. There is Opaque, Cutout, Fade, and Transparent. If you choose Opaque, any "natural" transparency for the 2D image placed in the Albedo of the material will show as black. It also seems Opaque is selected by default.

I choose the Cutout option because it provides the most sheer edge around the image, which typically suits my needs (2D, sharp edging). But depending on what your needs are, you may wish to play with the setting for a few minutes to see its effects and pick the one that best suits you. Hope this helps!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

www.LoadImageIntoTexture doesn't work? 1 Answer

Image files from folder with System.IO into array converted to WWW.texture and applied to Instantiated prefab 1 Answer

cannot set texture 0 Answers

Unlit/Transparent texture leaves dark lines on the transparent edges 1 Answer

cant get Texture2D.LoadImage() to work 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