text
stringlengths 0
1.11k
|
---|
Prerequisites |
Your Unity project should be properly set up to run on Meta Quest devices. If you are starting from scratch, feel free to refer to the steps in Build Your First VR App. |
Install Meta XR Simulator |
For Unity projects, we recommend installing Meta XR Simulator via Unity’s Asset Store: |
Navigate to Meta XR Simulator on Unity Asset Store. |
Add Meta XR Simulator to your assets. If not added already, then click Open in Unity. |
The Package Manager window should now be open in your Unity project and displaying details about Meta XR Simulator. |
Click install to add Meta XR Simulator into your Unity project. |
Alternatively, you can install Meta XR Simulator manually: |
Navigate to Meta XR Simulator on the Meta Developer Center website and click the Download button. |
Extract the contents of the downloaded zip file. A tarball file (ending in .tar.gz) should be present. |
Within your Unity project, go to Window > Package Manager via the menu bar. |
Click the + sign, and then select Install package from tarball..., and navigate to the extracted tarball. Unity installs the tarball. |
Close the Package Manager window. |
For more information, see our documentation regarding Unity Package Manager. |
Start Meta XR Simulator |
Once you have imported the Meta XR Simulator, you must activate it. On the menu bar, go to Oculus > Meta XR Simulator > Activate to activate the simulator. There will be a log message titled Meta XR Simulator is activated indicating that the activation is successful. |
There will be a log message indicating that the activation is successful. |
Then, you can run your Unity application by clicking the Play button. The Debug Window of Meta XR Simulator will open. You can drag the panels to arrange them for your convenience. |
The Debug Window of Meta XR Simulator will open. You can drag the panels to arrange them for your convenience. |
Stop Meta XR Simulator |
To stop Meta XR Simulator, you can either click the Play button again from Unity or click the Exit Session button at the top left corner of the Debug Window. If you want to go back to development on your physical headset, you can deactivate the Meta XR Simulator by selecting Oculus > Meta XR Simulator > Deactivate. |
Running mixed reality applications |
To run a mixed reality application in the Meta XR Simulator, in addition to activating it, you will need to launch the Synthetic Environment Server (SES) that enables mixed reality simulations. Select one from the three simulated environments through the menu Oculus > Meta XR Simulator > Synthetic Environment Server. You will see a server window popping up: |
You will see a server window popping up once it begins running. |
You can now minimize this window and have it running in the background. As usual, click the Play button and you should find your game running inside the simulated environment of your choice. |
As usual, click the Play Button and you should find your game running inside the simulated environment of your choice. |
To stop the synthetic environment server, select Oculus > Meta XR Simulator > Synthetic Environment Server > Stop Server. It is recommended that Meta XR Simulator is exited first. |
Meta XR Simulator does not support hot-switching between environments, but you may switch to another environment without closing the first one when the simulator is not running. To do so, just launch another server while the first one is running, and click Yes in the pop-up dialog: |
Launch another server while the first one is running, and click Yes in the pop-up dialog. |
(Optional) Using a sample scene to validate your installation |
Install the Meta XR Simulator Samples package from the NPM Registry using Unity Package Manager. |
Open SceneManager in the following location: Open SceneManager |
In the scene, select OVRCameraRig, and in the inspector, remove the Passthrough Play In Editor script: In the scene, select OVRCameraRig, and in the inspector, remove the Passthrough Play In Editor script |
Following the instructions in the Running Mixed Reality Applications section, activate the simulator and launch a synthetic environment server. Then, click the Play button and you should see scene entities superimposed on the passthrough environment: Following the instructions in the Running Mixed Reality Applications section, activate the simulator and launch a synthetic environment server. |
Troubleshooting |
The debug window of Meta XR Simulator didn’t open after clicking the Play button in Unity editor. |
Assuming that you have successfully installed the XR Simulator package and activated it, the next thing you may want to check is the XR Provider setting. Meta XR Simulator is an OpenXR runtime, and will only be loaded when the OpenXR Provider is initialized. You may want to check the Standalone tab of XR Plugin Management settings, and enable the same XR Provider that is enabled in the Android tab (for example, the Oculus XR Plugin). |
The XR Provider under the Standalone tab will be used in Unity editor, while the provider under the Android tab will be used on Meta Quest.Meta XR Simulator Passthrough Scenes |
The platform for which this article is written (Unity) does not match your preferred platform (Nativa). |
Haz clic aquí para ver la página del índice de la documentación para tu plataforma de preferencia. |
Overview |
Meta XR Simulator allows developers to simulate their MR applications in three realistic synthetic environments: a game room, a living room, and a bedroom. Your application will be able to leverage the scene information embedded in the environments, in addition to the passthrough content. |
Showing the game room scene. |
Showing the living room scene. |
Showing the bedroom scene. |
*Note: Passthrough stylization is not supported. |
If you’re using Meta XR Simulator with Vulkan, you will need to manually set a configuration parameter for passthrough to work. First, open /path/to/MetaXRSimulator/config/sim_core_configuration.json. Then, set the value of ses_texture_format to be jpg. DirectX APIs currently have better performance in passthrough simulation. |
DidBuild Your Own Synthetic Environment Server |
The platform for which this article is written (Unity) does not match your preferred platform (Nativa). |
Haz clic aquí para ver la página del índice de la documentación para tu plataforma de preferencia. |
Overview |
The Synthetic Environment Builder lets you use your own synthetic environment for mixed reality simulation in the Meta XR Simulator. It is a UPM package that you can import into your Unity project containing a synthetic environment, and turn that project into a Synthetic Environment Server. |
Getting Started |
Open the Unity project containing the synthetic environment you want to use for passthrough simulation (henceforth referred to as the “server project”). Note: the server project cannot be an XR project. |
Import the Synthetic Environment Builder package using the package manager. |
Under , open :SynthEnvServerScene Annotation Tool |
Illustrating the Scene Annotation Tool menu option in the Unity Editor. |
An editor window will pop up: |
Illustrating the graphical interface of the Scene Annotation Tool editor window. |