deploying_to_android.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. _doc_deploying_to_android:
  2. Deploying to Android
  3. ====================
  4. Setup
  5. ------------
  6. Most mobile headsets run on Android and OpenXR support is making its way to these platforms. There are specific requirements for deploying XR projects to Android.
  7. For general requirements around exporting to Android, please first read :ref:`doc_exporting_for_android`.
  8. .. note::
  9. Official support for the Android platform wasn't added to the OpenXR specification initially resulting in various vendors creating custom loaders to make OpenXR available on their headsets.
  10. While the long term expectation is that all vendors will adopt the official OpenXR loader, for now these loaders need to be added to your project.
  11. Custom Android build
  12. --------------------
  13. In order to deploy the loaders into your project you will need to setup a custom Android build.
  14. Select **Install Android Build Template...** from the **Project** menu:
  15. .. image:: img/android_custom_build.webp
  16. This will create a folder called **android** inside of your project that contains all the runtime files needed on Android. You can now customize this installation. Godot won't show this in the editor but you can find it with a file browser.
  17. You can read more about custom builds here: :ref:`doc_android_custom_build`.
  18. Installing the loader plugins
  19. -----------------------------
  20. The loaders can be downloaded from the asset library, search for OpenXR Loaders and install the plugin:
  21. .. image:: img/openxr_loader_asset_lib.webp
  22. You will find the installed files inside the **android** folder.
  23. There is a subfolder called **plugins** containing the new files.
  24. You can find the main repository of the loader plugin `here <https://github.com/GodotVR/godot_openxr_loaders>`__.
  25. Creating the export templates
  26. -----------------------------
  27. You will need to setup a separate export template for each device as each device will need its own loader included.
  28. Open **Project** and select **Export..**.
  29. Click on **Add..** and select **Android**.
  30. Next change the name of the export profile for the device you're setting this up for, say **Meta Quest**.
  31. And enable **Use Gradle Build**.
  32. If the loader plugins were installed correctly you should find entries for the different headsets, select the entry for meta:
  33. .. image:: img/android_meta_quest.webp
  34. Scroll further down the list until you find the **XR Features** section.
  35. Change the **XR Mode** to **OpenXR**.
  36. The hand tracking and passthrough settings here currently only work for the Meta Quest and you will need to select the appropriate settings if you wish to use these features.
  37. .. image:: img/xr_export_features.webp
  38. Now you can repeat the same process for the other devices. Note that if you wish to test your game with Godots one-click deploy, you have to mark the export profile for your device as **Runnable** so Godot knows which loader to deploy.
  39. .. note::
  40. There are separate loaders for the Meta Quest, Pico and Lynx R1 headsets.
  41. The fourth option is the official Khronos (KHR) loader, in due time all headsets should work with this loader.
  42. At the moment this loader has been tested with the Magic Leap 2 and standalone HTC headsets.
  43. .. warning::
  44. While the Mobile Vulkan renderer has many optimizations targeted at mobile devices, we're still working out the kinks.
  45. It is highly advisable to use the OpenGL renderer for the time being when targeting Android based XR devices.
  46. Note that we are awaiting driver updates on various devices before Vulkan support will work on these.