• 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 rich2020 · Mar 19, 2018 at 11:15 AM · pinktexure

Textures loaded from bytes are pink in build

I am loading an image (just a byte array) into a texture and applying it to a plane. The image in question is a screenshot taken from the desktop and exists only in memory - it never gets saved to disk.

Here is how I am applying the image to the plane:

 var viewingPlane = new ViewingPlane();
 viewingPlane.Texture = new Texture2D(window.Width, window.Height, TextureFormat.RGBA32, false);
 viewingPlane.Texture.LoadImage(window.Frame);
 viewingPlane.Texture.Apply();

Don't worry about ViewingPlane, that is just a custom object for scene management.

Anyway, this works fine in the editor and my textures are correctly applied. However, in build mode, everything is pink/magenta.

The image is being created using another application I made and the DLL is added to my Unity3d project, where it is used to extract screenshots. The DLL is built for x64 and Unity3d is built for x86_x64.

When I check my output_log.txt file, I notice this:

Fallback handler could not load library C:/Users/Rich/MyProject/Builds/Main_Data/Mono/libc

Fallback handler could not load library C:/Users/Rich/MyProject/Builds/Main_Data/Mono/libc.dll

Fallback handler could not load library C:/Users/Rich/MyProject/Builds/Main_Data/Mono/libc

I've read all the questions/answers I can find on this and have reset shaders, etc, but nothing is working. I'm on Windows 10 and Unity version 2017.3.1f1.

Any ideas?

Comment
Add comment · Show 8
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 meat5000 ♦ · Mar 19, 2018 at 11:27 AM 1
Share

Pink = $$anonymous$$issing/broken $$anonymous$$aterial

avatar image fafase meat5000 ♦ · Mar 19, 2018 at 11:35 AM 1
Share

Just to add to this, if it were a texture issue, you'd get the red question mark texture. So most likely, your shader is not supported or the material is missing.

avatar image meat5000 ♦ · Mar 19, 2018 at 11:28 AM 0
Share

https://www.google.co.uk/search?q=unity+pink&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&dcr=0&ei=tp6vWtTmN-mBtgfj_rLQDg

avatar image rich2020 · Mar 19, 2018 at 11:42 AM 0
Share

How can the material be missing? It is never created on disk. It's solely in memory. The image is a screenshot of the desktop, loaded into a byte array and then applied to the texture.

avatar image rich2020 · Mar 19, 2018 at 11:43 AM 0
Share

@meat5000 If you'd read my question, it would be clear to you that I have Googled.

avatar image meat5000 ♦ rich2020 · Mar 19, 2018 at 12:02 PM 0
Share

Um no? The word Google doesnt even appear in your question, so definitely wasnt clear, no. Did you make sure all the shaders you use are both compatible and included in default shaders list? You apparently must include variants. The link was simply so you can observe the extend to which pink = missing material, so you know what to focus on. Check your relevant shader includes a Fallback option within it.

Some people have said that in a case where everything is pink, its an issue with Image Effects. Dont know if this will help you? There is a chance this issue arises from working from a Protected Directory, such as Desktop and certain places in the Users folder. Try relocating to a folder just off the c: drive. C:/WOR$$anonymous$$/ Or something like that.

avatar image Bonfire-Boy · Mar 19, 2018 at 05:24 PM 0
Share

What shader does your $$anonymous$$aterial use? If you are creating the $$anonymous$$aterial in code then it could be that the shader is not being included in the build. You can force the shader into the build by going to Project Settings -> Graphics and adding it to the "Always included shaders" list.

(while the above is alluded to in meat5000's comment as "default shaders list", it seemed to be worth spelling out a bit more as a possibility/solution)

Show more comments

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

117 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

Related Questions

Lerpz Jet Particles are Pink 4 Answers

Pink screen on ESC 1 Answer

All objects are pink!!! 4 Answers

Terrain Detail Texture 0 Answers

everything became pink 13 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges