Using OpenXr for multiple devices

I’m using unity 6000.0. 28f1.How we take a single build and use for multiple devices such as for Quest, Pico and HTC vive using OpenXR?

This seems to be a complicated question. I can’t find any information about cross-platform applications at all :wink: And here Port Quest app to other platforms is my question also without answers. I also want to understand how to properly develop an application so that it works on pico and quest. I don’t want to have several applications and then pull changes from one to another

I could be wrong, but wouldn’t you handle just it like any other cross platform game?

but even if I use openXR features I won’t be able to use both meta quest features and HTC vive features. It throws an error saying “Only one OpenXR feature may have a custom runtime loader per platform. Disable VIVE XR Support or Meta Quest Support”. How can I have support for both HTC vive and meta quest features as a single application?

I’m not a big expert in games. But for example, applications like deovr seem to be cross-platform.

You likely won’t be able to create a single build (i.e. an APK) that can run on all platforms. You’ll have to create a build for each platform.

What OpenXR gives you is the ability to code against a common API that will work on any platform. For example, you don’t need to use OVR which will only work on Meta devices.

Unity 6.1 gives you the ability to create Quest vs AndroidXR build profiles for this reason.

Caveat: OpenXR feature groups are still buggy. If you were to uncheck the Meta feature group so you can check the AndroidXR feature group, the Meta features will stay selected. Which defeats the point of feature groups… I’ve filed a bug report about this but haven’t heard any updates on it.

Workaround: Create an editor script that has a list of OpenXR features you want, then when you run it, all features are cleared then set the ones you want.

You are right. I created custom build profiles for meta and pico. I also create editor script that switch build profile and disable and enabled required features. And it works like charms.

How were you able to turn the OpenXR features on and off for each Build Profile?

Sorry for late answer. Here is my editor script OpenXRPlatformSwitcher.cs · GitHub

3 Likes

Thank you so much! I tried to ‘vibe code’ it with Gemini, and ended up knee deep in a mess … appreciate it.

The OpenXRPlatformSwitcher.cs script has dependency on BuildVersionSetup.cs script, can you provide that script?

I’ve deleted lines in gist where this script used. You don’t need it because this depends require only for my project :wink:

It’s a feature not a bug - why do you think the checkboxes are multi-select? you want the option to be able to create an apk that works across devices - I’ve managed creating a single apk for all devices without that script which breaks the point of OpenXR. By not checking the main features that provided custom loaders Unity would provide the Khronos OpenXR loader - they now finally provide the standard one for all their OpenXR plugins and do select all of the rest of the extensions features for each device except where they interfere with each other (when more than one device uses the same vendor extension - which could be a bug on one of the runtimes)