Search Unity

Everything Canvas turns pink, when playing windows build

Discussion in 'General Graphics' started by Zimbres, Jun 17, 2016.

  1. Zimbres

    Zimbres

    Joined:
    Nov 17, 2014
    Posts:
    180
    Hello!

    Someone knows why this happens? I've googled a bit, and I've found an interesting lead: this sort of thing happens when the shader is not pre-loaded. But... if this is happening only with uGUI elements, so... I've got clueless. First time this happens to me.
     
    SamuellH12 and Lohoris2 like this.
  2. Zimbres

    Zimbres

    Joined:
    Nov 17, 2014
    Posts:
    180
    nobody?
     
  3. Zimbres

    Zimbres

    Joined:
    Nov 17, 2014
    Posts:
    180
    (SOLVED) Looks like my project settings got corrupted. Deleting the folder and restarting unity solved. Now I will try to re-do this without messing my game.
     
  4. aligaman22

    aligaman22

    Joined:
    Nov 26, 2014
    Posts:
    1
    Hi Zimbres, I am having the same problem you had with canvas turning pink on build, just wondering how you solved it through Project settings?
     
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    Check that the UI shaders are included in the build settings.
     
    andonyE likes this.
  6. HolyManoly

    HolyManoly

    Joined:
    May 14, 2014
    Posts:
    8
    I can't seem to fin that option in the File -> Build Settings.
    Where exactly is the option of including shaders ?
     
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    its one of the project settings. Edit/project settings. I can't remember which one, hopefully it won't be hard to find
     
    SamuellH12, BrianJiang and Qosquo like this.
  8. k234234w

    k234234w

    Joined:
    Sep 8, 2013
    Posts:
    8
    Edit/ProjectSettings/Graphics. Fill out the Always Included Shaders. Starting a new project size = 7, Legacy Shaders/Diffuse, Hidden/CubeBlur, HiddenCubyCopy, Hidden/CubeBlend,Sprites/Default,UI/Default,UI/Default Font.
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    If you right click at the top of the inspector page for built-in shaders and choose reset it should fix it for you automatically.
     
    Zotooo, Propagant, man-teiv and 12 others like this.
  10. aikijeet

    aikijeet

    Joined:
    Jun 19, 2013
    Posts:
    3
    This fixed the problem

    Thanks a lot sir
     
    masta-yoda and karl_jones like this.
  11. aguazul

    aguazul

    Joined:
    Feb 11, 2017
    Posts:
    1
    Thanks! This helped me, too. The little gear at the top of the inspector page for built in shaders --> Reset

    I was having trouble with the GvrFPSCanvas prefab because it was pink! But this did the trick!
     
    ProbePLayer and karl_jones like this.
  12. lowbrow

    lowbrow

    Joined:
    Mar 7, 2017
    Posts:
    1
    Dude you are awesome !!!
     
    masta-yoda likes this.
  13. developer6DLAB

    developer6DLAB

    Joined:
    Oct 31, 2016
    Posts:
    4
    Wow, It's true. I can't believe it.
    The problem is SOLVED when I do "reset" in Graphic Settings!!
     
  14. BrianJiang

    BrianJiang

    Joined:
    Jun 11, 2017
    Posts:
    7
    Thank you very much!!
     
  15. AshwaniShinde

    AshwaniShinde

    Joined:
    Sep 27, 2014
    Posts:
    20
  16. wankerman

    wankerman

    Joined:
    Jun 10, 2015
    Posts:
    7
    That did it! Thanks!
     
  17. BytesCrafter

    BytesCrafter

    Joined:
    Apr 16, 2016
    Posts:
    8
    karl_jones likes this.
  18. ninjadragon777

    ninjadragon777

    Joined:
    Jul 30, 2017
    Posts:
    2
  19. PCenrich

    PCenrich

    Joined:
    Jul 5, 2017
    Posts:
    8
    Greetings!

    Forgive me for adding to this threads, I am very new to Unity and also struggling with the dreaded pink screen...
    I am attempting to open a project file that a previous co-worker built and saved in a Shared Drive. When it opens.. nothing but PINK. Under Project Settings Graphics I have the following :
    6, Legacy Shaders/Diffuse, Hidden/CubeBlur, HiddenCubyCopy, Hidden/CubeBlend,Sprites/Default,UI/Default,UI/Default Font.

    I attempted to reset graphics but I have had no success, any suggestions?
    Images of Settings attached
     

    Attached Files:

  20. Xonatron

    Xonatron

    Joined:
    Jan 14, 2013
    Posts:
    31
    Same as PCenrich.

    I am getting pink rendering on Unity cubes, only in builds not in the editor.

    I have deleted the Project Settings and had Unity recreate them. No luck.

    I double checked the Project Settings > Graphics > Graphics Settings > Always Included Shaders and I have the following:

    After resetting I have the following:

    6
    0 Legacy Shaders/Diffuse
    1 Hidden/CubeBlur
    2 Hidden/CubyCopy
    3 Hidden/CubeBlend
    4 Sprites/Default
    5 UI/Default

    After running the program in Unity, it remains the same. No pink.

    After building the program, it switches to this and executes with pink:

    7
    0 Legacy Shaders/Diffuse
    1 Hidden/CubeBlur
    2 Hidden/CubyCopy
    3 Hidden/CubeBlend
    4 Sprites/Default
    5 UI/Default
    6 Hidden/VideoDecode

    Any ideas?
     
    NeatWolf likes this.
  21. futurlab_peterh

    futurlab_peterh

    Joined:
    Jan 23, 2018
    Posts:
    38
    For anyone that couldn't fix this by resetting the shaders: I was able to fix it by changing/updating .NET libraries on Visual Studio Installer.

    We were building the exact same project to Switch on 2 different PCs: one of them would work perfectly, the other would only produce magenta screens with a bunch of shader error/warning messages when trying to build from Unity 2018.3.0b12 (building from Unity 2018.2 worked on both). Resetting the shaders (or any of other tons of things we've tried) had no effect.

    upload_2018-12-5_9-33-46.png

    So what we did was to export the configuration from the PC where builds were fine, importing it on the other PC, and the next build magically worked. Unfortunately I didn't take note of the previous configuration to know which component(s) caused the issue.

    If you don't have a working configuration to export, I'd suggest modifying your .NET environment, updating and/or adding components. This is what it looks like on mine:

    upload_2018-12-5_9-36-47.png upload_2018-12-5_9-37-1.png

    I hope this helps!
     
    ASydorov likes this.
  22. ASydorov

    ASydorov

    Joined:
    Feb 26, 2019
    Posts:
    1
    futurlab_peterh likes this.
  23. CrowbarSka

    CrowbarSka

    Joined:
    Dec 15, 2009
    Posts:
    192
    Can anyone recommend a workaround for those of us (i.e. me) using VS Code instead of the full Visual Studio? Resetting shaders didn't work. Sounds like a fix is coming in 2019.3 but I really need a working project soon.
     
  24. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Oh, thank you!

    I really have been bumping my head on the wall half a day, and of course it had to be something shader-related.

    I cleared that list months ago, I totally forgot I've been overzealous with "optimization" :p

    After adding the first 7 suggested by pressing the reset cog button on the Graphics settings, I undoed that, added them back manually, and after the next build the list got automatically expanded to this one:

    (Unity 2019.2.9f1, targeting Android)

    I'm really not sure about the reason videocompositing shaders got added, (probably I left some builtin package enabled), but I learnt not to mess too much with builtin packages especially with an impending deadline :D

    I really wished Unity would have warned me about those shaders being missing, since I was clearly using them and before building for Android!

    I guess it's not that easy to determine tho, otherwise such feature would be already there :)
     
    gn_mobilesoft likes this.
  25. Bilgisoft

    Bilgisoft

    Joined:
    Sep 2, 2016
    Posts:
    13
    I solved this problem with 2 step.

    1- Project Settings/ Graphics --> Reset (in top of inspector)
    2- Add Sprites/Diffuse in Always Included Shaders manuel.
     
    Last edited: Dec 19, 2019
    kerzeelo likes this.
  26. Xonatron

    Xonatron

    Joined:
    Jan 14, 2013
    Posts:
    31
    What solved my issue was creating a prefab and instantiating game objects via prefabs rather than primitives... it likely does automatically some of the same things found in other solutions here (such as including a shader and whatnot).
     
  27. DennisBest

    DennisBest

    Joined:
    Mar 8, 2014
    Posts:
    6
    dude a simple restart helped the UI come back
     
  28. MrJanci

    MrJanci

    Joined:
    Sep 19, 2021
    Posts:
    1
    Thanks dude!
     
  29. unity_0WVfvDydm3tsrA

    unity_0WVfvDydm3tsrA

    Joined:
    Aug 20, 2021
    Posts:
    1
    Thanks a lot
     
  30. paulcodemonkey

    paulcodemonkey

    Joined:
    Oct 11, 2016
    Posts:
    15
    I saw the pink-screen-of-death on iOS device when updating to Unity 2019.4.31 (latest LTS at the time).
    I had never seen this issue before now.
    My graphics settings were all correct (tried the 'reset' option in GraphicsSettings) and also confirmed Metal graphics API in PlayerSettings.
    This is an old project that doesn't use the new render pipelines.
    At runtime I saw messages like:

    "WARNING: Shader Unsupported: 'Sprites/Default' - All passes removed"

    Looking at the release notes of 2019.4.31 I saw the following line:

    "Graphics: Reduced main thread hitching caused by Shader loading."

    That looked suspicious so I downgraded my project to Unity 2019.4.30 and now everything is fixed. I didn't investigate any further.
    Just mentioning this here in case someone from Unity wants to chase it up.
     
  31. p0w1nd

    p0w1nd

    Joined:
    Oct 28, 2015
    Posts:
    140
    I have two 3D projects which are also experiencing this pink screen issue.

    Project 1:
    - Unity 2019.4.30f1: everything works perfectly
    - After upgrading to Unity 2019.4.31f1: pink screen when launch (on iOS, Android devices; normal on Unity Editor)

    Project 2:
    - Unity 2020.3.18f1: everything works perfectly
    - After upgrading to Unity 2020.3.19f1: pink screen when launch (on iOS, Android devices; normal on Unity Editor)

    Worth to note that in both projects:
    - The pink issue does not happen if building for iOS/Android from Unity Editor
    - It only happens when I build with command line (headless) mode

    There's something changed since the new Unity versions that causes this? I hope someone from Unity can help.
     
    unity_NIIbl7SGavIp8A likes this.
  32. p0w1nd

    p0w1nd

    Joined:
    Oct 28, 2015
    Posts:
    140
    I notice this difference in the build log while building in headless mode on the terminal:

    With Unity 2020.3.18f1:

    With Unity 2020.3.19f1:
    Note that it's always "0 variants" with Unity 2020.3.19f1 (which results in the pink issue). It looks like shaders are not compiled at all. I wondering why that?

    -----

    Another observation:

    If I remove the "-nographics" flag in the build command, the resulting build works well (no pink issue), the log output looks like in 2020.3.18f1. Problem SOLVED!!
     
    Last edited: Oct 26, 2021
  33. paulcodemonkey

    paulcodemonkey

    Joined:
    Oct 11, 2016
    Posts:
    15
    Oh very interesting. In my previously mentioned case I am also building in headless mode.
     
  34. DanielDouglas

    DanielDouglas

    Joined:
    Mar 21, 2020
    Posts:
    4

    Thank you for solving my problem, your answer was very helpful
     
    futurlab_peterh likes this.