Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug URP shaders rendering pink / magenta in Oculus Quest build after upgrading to 2019.4 LTS

Discussion in 'Universal Render Pipeline' started by DanjelRicci, Sep 9, 2020.

  1. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    262
    I have a 2019.3.0 URP project targeting Oculus Quest working without any issues. After updating to 2019.4.9 (also tried with 2019.4.8) and touching no settings at all, every single shader in the Quest build is totally pink including the Made With Unity splash, literally a full pink screen, while the game still works and reacts to my inputs. Everything looks fine in the Unity editor though. I've been trying to find a solution to this isse for some time, but I still got nothing.

    I would really love to switch to a LTS release for the sake of bug fixing and support, but I'm stuck with 2019.3.0, the one and only version that seems to break nothing in terms of plain functionality.

    Using XR Plugin Management 3.2.13, Oculus XR Plugin 1.4.3 and official Oculus Plugin 20.0 (this one even before updating to 2019.4 LTS).

    EDIT: I updated from URP 7.3.1 to 7.4.3 and it asked me to update the shaders too, which I did- but these are still pink on Quest.
     
    Last edited: Sep 9, 2020
    rlalancette and johnpccd like this.
  2. ThomasZeng

    ThomasZeng

    Unity Technologies

    Joined:
    Jun 24, 2019
    Posts:
    61
    Hello @DanjelRicci
    Thanks for letting us know.
    Could you please send us a bug with a repro case so that we can look into? Thanks!
    Also did you change URP version when updating from 19.3 to 19.4?
     
  3. daves

    daves

    Unity Technologies

    Joined:
    Oct 18, 2018
    Posts:
    22
    Hi Danjel,

    Are there any clues in the Unity Editor log? That sounds very much like a shader compilation issue, and there should be some error reported somewhere.
     
  4. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    262
    Well, the issue kinda disappeared on its own after I spent some time doing almost random stuff.
    What I think solved the issue was the consequence of a number of things aligning up, but I don't know exactly at what point the issue disappeared. Basically after some time fiddling with settings and plugins, I made yet another build to test if a plugin compiled, and then everything just worked.

    Here it is a more or less generic list of things I did:
    - Backup project, update from 2019.3.0 to 2019.4.8 (URP updated too, but I got no messages of sort)
    - Build, get the broken shader issue
    - Update to 2019.4.9, also upgrade the Oculus plugin
    - Compile, get broken shaders again
    - Tried changing some Pipeline Asset options like AA, shadows, etc
    - Build again, issue still there
    - Gave up with fixing, got a couple of URP assets from the Asset Store to use in the future, Fast Sharpen and Fast Motion Blur
    - Spent some time fiddling with URP and the new assets
    - Upgraded URP from 7.3.1 to 7.4.3, this time I got an upgrade message, I followed it
    - Compile again, issue still there
    - Fiddle again with the bought assets
    - Restart Unity, can't remember the reason
    - Build again... Now it works.
    - More tests, more builds, all good finally.

    At some point during this all I also tried to delete the Oculus XR integration, then added it all again.
    I attached the last logs, hope they contain some useful info, at this point I'm quite sure I missed some important message along the process.

    EDIT: Ah, I almost forgot! Not really related but maybe of interest: I've been getting low performance in the build done with 2019.3.0 for the last month or two, basically from 72 to 30 fps and less when various non-static objects were on screen. I tried optimizing literally everything I had in the project, but it didn't go back to the smoothness it had before, couldn't find what I changed that degraded performance so much.
    After upgrading to 2019.4.9, everything returned smooth as before (and then some more thanks for the further optimizations I did in the meantime).
    I love you Unity, but at times you are puzzling!
     

    Attached Files:

    Last edited: Sep 10, 2020
  5. ThomasZeng

    ThomasZeng

    Unity Technologies

    Joined:
    Jun 24, 2019
    Posts:
    61
    I'm glad to hear the issue is no longer blocking you @DanjelRicci !
    And thanks for the log file, they are useful for us! We plan to dig this log on our end and also ask our QA to try to repro the issue.
    From the steps you described, sounds like during the upgrade process, something bad happened about the shader cache. And I suspect at some point the old cache is removed and forced a shader recompile. We will look into this more.

    Regarding the perf issue you mentioned, that sounds to me something around vsync. If it ever happened again, feel free to log a bug with repro project so that we can take a look!

    Thank you and have a great day!
     
    johnpccd and DanjelRicci like this.
  6. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    262
    This seems a very plausible case for what happened.

    Interesting, as far as I remember, vsync is automatically enabled for mobile devices so I always though that changing it did nothing for Quest. In fact I changed it a bunch of times but I don't recall performance being different... At the moment for 2019.4.9 is set to Don't Sync and things are super smooth.

    Thanks a lot anyways! Have a great day too, you and the team. :)
     
  7. humansteak

    humansteak

    Joined:
    Feb 4, 2016
    Posts:
    35
    Hi! I am experiencing about the same and not finding my solution :s
    All pink in game, alright in the editor, I did the material upgrade etc. already.
    Just like you just switched and updated to 4.31 URP. Unity 2019.4.8
     
  8. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    262
    Considering what happened I'd try to delete the shader cache to force a recompile, just like ThomasZeng suggested. It's located in [project root]/Library/ShaderCache.
     
  9. humansteak

    humansteak

    Joined:
    Feb 4, 2016
    Posts:
    35
    So after fooling around for a while as well I got things running.
    Thanks for sharing though it kept me motivated when last minute F***up happens :p
     
    DanjelRicci likes this.
  10. johnpccd

    johnpccd

    Joined:
    Jun 21, 2020
    Posts:
    7
    +1

    I also noticed inconsistent shader output (same code different builds)
     
  11. Chris_Payne_QS

    Chris_Payne_QS

    Joined:
    Jul 16, 2016
    Posts:
    80
    I have a similar issue on 2019.4.9 and URP 7.4.3
    New desktop machine, fresh checkout of project - standalone build is missing half the shaders. Editor is fine. Same checkout on my old laptop is fine in both editor and standalone. Deleting shader cache makes no difference, the missing shaders are consistent but not sure what the pattern is. Shader Forge and speedtree ones are missing, but URP Lit, terrain shaders and at least one custom hand-coded one are present.

    [EDIT, SOLVED: I had an overzealous shader stripper plugin that I had added to the project long, long ago and forgotten about. Leaving spurious complaint here for posterity ;) ]
     
    Last edited: Sep 21, 2020
  12. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    126
    For anyone else experiencing this issue, I met the same issue while trying out the new OVR Manager feature "skip unneeded shaders". Even though this was applied on a component in another scene that wasn't even in the build, and that I had completely forgotten about, it still has project wide application, so make sure you disable it!
     
  13. Matiasbru

    Matiasbru

    Joined:
    Sep 1, 2015
    Posts:
    20
    This solved my problem! thanks!

    More info here:
    https://developer.oculus.com/documentation/unity/unity-strip-shaders/
     
    unnanego likes this.
  14. SugarSores

    SugarSores

    Joined:
    Jul 4, 2012
    Posts:
    9
    YOO! This was it!! Thanks, bud :D
     
  15. matthoadrobson

    matthoadrobson

    Joined:
    Dec 30, 2017
    Posts:
    9
    I'm completely stuck with this it seems impossible to get it to build without the entire screen being pink! We also went from standard to URP. It plays fine in the editor.

    I've tried:

    Deleting the shader cache
    Adding a bunch of shaders to the always include list
    Adding more shaders to the preloaded shaders list
    Turned off skip unneeded shaders in both OVRManager and the Unity settings

    Any other suggestions? Mighty stuck!

    M
     
  16. sandstedt

    sandstedt

    Joined:
    May 24, 2015
    Posts:
    50
    @matthoadrobson Did you solve it? I had checked the "skip unneeded shaders" in the OVRCameraRig prefab that had the script OVRManger on it. Unchecking it fixed my problem. So make sure, as TheVirtualMunk said, you don't have any OVR Manager script somewhere else in you project.

    upload_2021-3-7_14-8-41.png
     
    Gabriel_Albyon likes this.
  17. gmgannon

    gmgannon

    Joined:
    Sep 24, 2020
    Posts:
    6
    Had same issue here using 2020.3.1f1 with URP 10.3.2. Looked fine when running in editor, pink on device (quest 1.) Deleted shader cache, unchecked "skip unneeded shaders" from OVRManger. All seems to be working now, apk on device looks as expected.
     
  18. CristinaMiru

    CristinaMiru

    Joined:
    May 9, 2021
    Posts:
    1
    OMG @sandstedt YO ARE AWESOME. I have been trying to solve this problem for two days. At first the screen was black and if I removed the postprocess it was all pink. Removing that option everything works perfect. THANK YOU SO MUCH

    Mu Unity: 2019.4.18f1 with URP
     
    sandstedt likes this.
  19. TimZech

    TimZech

    Joined:
    Apr 5, 2016
    Posts:
    3
    @sandstedt Thank you so much! I spent the last two days just trying to get my fresh URP build running and this was the solution for me!
     
    sandstedt likes this.
  20. dboursiquot876

    dboursiquot876

    Joined:
    May 18, 2021
    Posts:
    1
    I also had the same issue using the Custom Hands prefab from the Oculus Integreaton package. What seemed to be the problem was that all the textures were using the Standard shader right from the package and since I was using the URP template the textures didn't appear until I went to change to Universal Render Pipeline / Lit shader. Screenshot (10).png
     
    rlalancette likes this.
  21. sandstedt

    sandstedt

    Joined:
    May 24, 2015
    Posts:
    50
    Yeah there is so many reasons a material goes pink. This other day I was playing around with the "Always included shaders" in the Graphics settings, when suddenly everything went pink. After a lot of debugging, in the end i noticed that I for some reason didn't have a scriptable render pipeline Settings-file reference in the Graphics settings for some reason.

    upload_2021-11-24_19-41-55.png
     
    xCraftRayX and rlalancette like this.
  22. rlalancette

    rlalancette

    Joined:
    Sep 20, 2014
    Posts:
    17
    Thank you sir! That fixed it!
     
  23. PanderaStudios

    PanderaStudios

    Joined:
    May 27, 2017
    Posts:
    4
    Thank you very, very much man!

    Unbelievable that I've been suffering for more than a week because of a check-box.

    Thanks
     
  24. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    126
    Happy to help! It's honestly the worst coding practice I've ever seen - also took me a couple of days to figure out. Very hard to imagine someone thinking this was a good way to implement a project wide feature o_O:confused:
     
    Last edited: Sep 28, 2022
  25. weiner_monkey

    weiner_monkey

    Joined:
    Aug 1, 2022
    Posts:
    24
    Have this same issue after switching from Vulkan to OpenGL (2021.3.9, URP 12.7), Skip unneeded shaders is disabled and as a good measure I've hard-coded it to false. Ive tried deleting the library folder as well. No shader is compiled (including splashscreen) and RenderDoc shows all shaders as Hidden/InternalErrorShader. If I change from Multiview -> Multipass, everything is pink meaning no shaders are compiled. Anyone have any idea how to fix this?

    EDIT:
    Project was using https://github.com/SixWays/UnityShaderStripper, which seemed to be causing the issue
     
    Last edited: Oct 20, 2022