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 OVRHandPrefabswith these steps and added a plane for ground reference. After that I added in URPwith 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.
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.
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.
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.