tks_yoshinagaの日記

KinectやLeap motion, VRやARなどの技術を使ってやったことのメモとか

AR Display Using MetaQuest's Passthrough Feature

0. Contents of This Article

This article introduces the steps to display 3D objects (cubes) in AR using Meta Quest. You can also confirm the operation in the 01-ShowObject-AR scene of the sample published on GitHub.

 

This article will edit scenes created with the following and convert them to AR. Please read this first. However, if you already have a VR scene using Meta XR SDK, you do not need to check the following article.

 

1. Duplicate the Scene

It is possible to edit the scene created in the previous article, but to try AR without breaking it, duplicate the scene. Skip if unnecessary.

  • Open the scene you want to convert to AR.
  • Click File -> Save As... to save the current scene with a new name. *In this article, it will be named ShowObject-AR.
  • Confirm that the scene name displayed in the Hierarchy is ShowObject-AR.

 

2. Enable Passthrough for AR Display

  • Select OVRCameraRig under the child elements of OVRCameraRigInteraction in the Hierarchy.
  • Find OVRManager from the detailed information of OVRCameraRig displayed in the Inspector.
  • Change Passthrough Support in the Quest Features section to Supported or Required.
  • Check Enable Passthrough in the Insight Passthrough section.

     

 

By these operations, the passthrough function itself will be enabled. However, passthrough video will not be displayed as it is, so add a layer to display the video with the following steps.

  • Click Add Component at the bottom of OVRCameraRig in the Inspector.
  • Search for Passthrough in the search area.
  • Click OVRPassthroughLayer.
  • Change Placement to Underlay in the added OVRPassthroughLayer in the Inspector.

     

 

3. Set Camera Background

Although the preparation for passthrough display has been completed with the above steps, building it as it is will only display the Skybox and will not be AR. Finally, change the camera background rendering settings to display the camera image.

  • Open TrackingSpace under the child elements of OVRCameraRig in the Hierarchy.
  • Select CenterEyeAnchor under TrackingSpace's child elements.

     

  • Find Camera in the Inspector and change BackgroundType from Skybox to Solid Color.
  • Change the color in the Background item to RGBA all 0.
    *It is important to set A to 0 to make it transparent.

 

4. Verification

[For Installation on Device]

  • Connect Quest and PC with a USB cable.
  • Click File -> Build Settings in Unity Editor.
  • Click Build And Run.
  • Set the installer (apk) name to alphanumeric characters and save it.
  • After the installer is generated and installed, the app will start automatically on Quest.
  • A cube should be displayed in front of you. If it appears in a different direction from the front, press and hold the meta (oculus) button on the right controller to reset the orientation.
  • If there is an error during installation, review the settings or create only the apk with Build once and install the app from SideQuest or MetaQuestDeveloperHub.

 

[Using Meta Quest Link (Windows)]

For details, please see the official page.

  • Connect Quest and PC with a USB cable.
  • Launch Quest Link on Quest.
  • Click the Play button in Unity Editor.
  • A cube should be displayed in front of you. If it appears in a different direction from the front, press and hold the meta (oculus) button on the right controller to reset the orientation.

 

tks-yoshinaga.hatenablog.com