Terrible build performance with URP and Meta SDK, conflicting information in documentation
Hi everyone,
The Unity setup guide on Meta Developers says to use the Universal 3D template, and it even mentions Unity 6 and makes a distinction to use the Oculus plugin before and Open XR plugin after, which to me seemed like a good sign that the documentation is well maintained.
However, if you keep following the documentation you will quickly run into errors caused by Meta XR SDK not being designed for anything other the the built-in RP. First I thought it was just the Interaction SDK samples not having been updated to URP, there are lots of broken built-in RP shaders like the water or mirror material in the locomotion example. That wouldn't be a big deal, but it's also coming straight from the core building blocks that you need to use. Even the most basic thing, the camera rig, immediately raises a red flag by causing this warning in the console:
Your project uses a scriptable render pipeline. You can use Camera.stereoTargetEye only with the built-in renderer.
UnityEngine.Camera:set_stereoTargetEye (UnityEngine.StereoTargetEyeMask)
OVRCameraRig:EnsureGameObjectIntegrity () (at ./Library/PackageCache/com.meta.xr.sdk.core@e9f929748630/Scripts/OVRCameraRig.cs:611)
OVRCameraRig:Awake () (at ./Library/PackageCache/com.meta.xr.sdk.core@e9f929748630/Scripts/OVRCameraRig.cs:196)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
And sure enough, if you build those examples scenes and run them on a Quest 3, you will get horrible performance even though there is barely anything to render. It's stuttering constantly unless you turn on passthrough to reduce rendering load to an absolute minimum. I don't think the URP configuration is to blame for this, the documentation makes no mention of changing the default URP settings by yourself and the Meta project setup tool already made all the changes it was supposed to and shows no further errors or warnings.
If you set up the exact same project in the built-in RP, the console warning from the camera rig script no longer appears and the build runs fine even without passthrough. I don't get it though, why would Meta explicitly tell you to use the URP if their own SDK does not support it? It literally tells you to install that SDK package right in the next paragraph of that exact same documentation page.
