Search Unity

Question Adding URP to Oculus Integration Package displays only pink on Quest

Discussion in 'VR' started by TheDarkHood, Mar 24, 2022.

  1. TheDarkHood

    TheDarkHood

    Joined:
    Aug 11, 2021
    Posts:
    5
    Hello!

    Everything seems fine and builds to the headset fine. However, when the game loads on Quest 2 it's just purple. I see purple in a 360 degree view all around, no hands or controllers or the plane I added appear. I am getting some warnings but I think it's for the OVRAvatar part of the Oculus Integration package that I am not using. Warnings are below for reference.

    I have previously developed for the Quest so I have gotten the default renderer to work before. However, I just started a new game and decided to use URP. I followed these steps to add in the Oculus Integration package and an OVRCameraRig. I also added in OVRHandPrefabs with these steps and added a plane for ground reference. After that I added in URP with these steps.

    Warnings:

    • Shader warning in 'OvrAvatar/AvatarSurfaceShaderSelfOccluding': use of potentially uninitialized variable (ComputeColor) at Assets/Oculus/Avatar/Resources/Materials/AvatarMaterialStateShader.cginc(168) (on d3d11)
    • Shader warning in 'OvrAvatar/AvatarSurfaceShaderSelfOccluding': Cannot concatenate '_LayerMaskAxis0' and '.' at Assets/Oculus/Avatar/Resources/Materials/AvatarMaterialStateShader.cginc(280)
    • Shader warning in 'OvrAvatar/AvatarSurfaceShader': use of potentially uninitialized variable (ComputeColor) at Assets/Oculus/Avatar/Resources/Materials/AvatarMaterialStateShader.cginc(168) (on d3d11)
    • Shader warning in 'OvrAvatar/AvatarSurfaceShader': Cannot concatenate '_LayerMaskAxis0' and '.' at Assets/Oculus/Avatar/Resources/Materials/AvatarMaterialStateShader.cginc(280)

    I haven't changed anything in the render pipeline. I did change the material for the OVRHandPrefabs to be a URP texture instead. I am not sure why this is happening at all or how to fix this since I am brand new to URP. All of the EyeAnchors are using the URP Balanced Renderer. I have posted my player settings, graphics, OVRCameraRig Settings and Hierarchy.

    Any help or ideas at what could be wrong would be awesome, I spent a couple hours changing settings and checking stuff but I haven't been able to make any progress. I'm clueless as to what to do next other than just start over and use the default pipeline. I'm happy to share other info or answer any questions.

    Player Settings:
    upload_2022-3-24_17-49-46.png
    upload_2022-3-24_17-50-29.png

    Graphics Settings:
    upload_2022-3-24_17-51-14.png
    upload_2022-3-24_17-58-34.png

    OVRCameraRig and Hierarchy Settings:
    upload_2022-3-24_17-56-47.png
     
  2. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    You might need to change all materials to use URP. Oculus ships their hand/controller models using built-in shader on all materials and so they'll be purple. I guess your plane and skybox materials are also using non-URP friendly shaders.
     
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    Yep, as said if you upgrade your materials.
    Google 'unity convert buildt in to urp [Unity Version]'
     
  4. TheDarkHood

    TheDarkHood

    Joined:
    Aug 11, 2021
    Posts:
    5
    I also thought that is what is was too, however, I changed the materials to URP unlit and lit and everything is still purple. I added a couple cubes in the scene along with attaching spheres to the hand anchors and nothing shows. I created a couple materials from the URP and none show up. I also changed the skybox to see if that would change anything and it doesn't either. I tried converting the materials as well using the method in the pic below with no change. I don't think it's a material thing as everything including URP materials are purple.

    upload_2022-3-25_15-46-20.png
     
  5. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    Is your project converted fully to URP? There are many tutorials you can find on DuckDuckGo but generally:
    - Package Manager > Universal RP > make sure it's installed and/or updated to newest version
    - Project tab > Create > Rendering > Universal Render Pipeline > Pipeline Asset
    - Edit > Project Settings > Graphics -> Select this new Pipeline Asset
     
  6. TheDarkHood

    TheDarkHood

    Joined:
    Aug 11, 2021
    Posts:
    5
    Yep, all of those were created and fully converted to URP.

    upload_2022-3-25_18-0-6.png
     
  7. MarkSharpe

    MarkSharpe

    Joined:
    Feb 3, 2021
    Posts:
    27
    Did you assign the URP a rendering quality level? upload_2022-3-29_9-47-42.png
     
  8. TheDarkHood

    TheDarkHood

    Joined:
    Aug 11, 2021
    Posts:
    5
    Yep, it has the balanced quality level

    upload_2022-3-29_14-0-40.png
     
  9. MarkSharpe

    MarkSharpe

    Joined:
    Feb 3, 2021
    Posts:
    27
    What happens if you unclick HDR (high dynamic range) then upgrade project materials to URP and push the APK to the headset?
     
    Last edited: Mar 29, 2022
  10. TheDarkHood

    TheDarkHood

    Joined:
    Aug 11, 2021
    Posts:
    5
    No change, still all purple.
     
  11. HardwareHaquer

    HardwareHaquer

    Joined:
    Oct 3, 2017
    Posts:
    2
    Not sure if you figured this out yet but I just had this problem and resolved it by finding the OVRManager component (for me on the OVRCameraRig) and Going to Build Settings (in the component not the option from the main menu) and unchecking Skip Unneeded Shaders. Apparently, it skips some very needed shaders... For me the project worked in the SRP but once I converted to URP (and fixed the obvious shader issues from the conversion)and built the project went pink in the headset. Took me a while to track that down...especially since the documentation for developing on the Oculus suggests check-marking that box. I assume the script that removes shaders was built for the SRP and doesn't account for whatever additional shaders the URP uses that are not linked in whatever method it is using to determined what is used.
     
    JofreMP, C-Notes, gmgannon and 2 others like this.
  12. OleksandrMartysh

    OleksandrMartysh

    Joined:
    Dec 13, 2015
    Posts:
    25
    Thanks a lot! This works for me!
     
  13. alfredberg90

    alfredberg90

    Joined:
    Nov 24, 2019
    Posts:
    2
    Thank youuuuuuuu
     
  14. JofreMP

    JofreMP

    Joined:
    Sep 20, 2019
    Posts:
    8
    Thanks a lot! It worked for me also. I followed a tutorial for Oculus optimization and it checked "Skip Uneeded Shaders" and that broke my project.