Develop
Develop
Select your platform

Build Your Own Test Room

Updated: Jun 10, 2024
Outdated XR Simulator Version
This information applies to an older version of the XR Simulator, for new projects use the Standalone XR Simulator which supports any OpenXR application.

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

  1. 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.
  2. Import the Synthetic Environment Builder package using the package manager.
  3. Under SynthEnvServer, open Scene Annotation Tool:
    Illustrating the Scene Annotation Tool menu option in the Unity Editor.
  4. An editor window will pop up:
    Illustrating the graphical interface of the Scene Annotation Tool editor window.
  5. Click Initialize Scene.
  6. Now your server project should be capable of passthrough simulation. To verify, run it in play mode. This will serve as the synthetic environment server. Meanwhile, run an MR application in Meta XR Simulator. You should see its passthrough content coming from the server project.

Adding scene information

The next thing to do is annotate your synthetic environment with scene information.

To label a 3D entity:

  1. Select a game object in the scene.
    A chair is selected in the Unity game editor.
  2. In the Scene Annotation Tool, make sure the Selected Object is correct, and then click Make 3D Scene Entity:
    Scene Annotation Tool UI after the chair is selected.
  3. The game object should now be surrounded by a bounding box:
    The chair is surrounded by a red wire box in the Unity Editor.
  4. Apply the correct semantic label. Adjust center/size if needed.
    Scene Annotation Tool UI with center/size and semantic label.

To label a 2D entity:

  1. Select the game object where the 2D entity plane is going to be attached to, for example, a desk:
    A desk is selected in the Unity game editor.
  2. In the Scene Annotation Tool, make sure the Selected Object is correct, and then click Make 2D Scene Entity:
    Scene Annotation Tool UI after the desk is selected.
  3. This will create a plane under the selected game object:
    A plane has been created but is in the wrong location (on the floor).
  4. Adjust the position and size of the plane to be at the desired place. Make sure its orientation accords with the following rules:
    • For ceilings, floors, and walls, the +y must point into the room.
    • For walls, doors, and windows, +x must point right, +z must point up, and +y must point into the room. A wall with right orientation setup.
    • For other panels, +y is the up direction. The plane is at the right location (on the table surface).
  5. Apply the correct semantic label.
    Scene Annotation Tool UI with semantic label.
Note:
  1. Copy-pasting a bounded 2D entity plane is not currently supported.
  2. Each scene must have exactly one ceiling and one floor. Aside from that, you can freely choose which objects to label according to your particular use case.
  3. Scene entities are highlighted by Unity Scene Gizmos. You can choose to not have them highlighted by unchecking Bounded 2D/3D Entities from the scene gizmos menu:
    Unity Scene Gizmos with Bounded 2D and 3D Entities highlighted.

Optional: displaying client positions in the server project

In the case of multiplayer simulation, it is helpful to know where each player is located when the server is running. The Synthetic Environment Builder offers the ability to create “position marks” for each player. Each position mark is a uniquely colored cube in the scene: Top-down view of a synthetic living room environment with three colored cubes.
To add position marks:
  1. Make sure the view of the main camera includes the entire scene. We recommend making it top-down.
  2. Add a Unity layer named Position Marks:
    Unity "Tags & Layers" Window with "Position Marks" added as a layer.

Wrapping up

At this point, your server project should be ready to go. To validate, run it in play mode and connect it to an MR application running in the Meta XR Simulator. Check whether the application has correct passthrough and scene information. We recommend using the Unity Scene Manager sample. Synthetic office scene with all scene entities highlighed in blue. Then, you can build your server project and use it as a synthetic environment server.

Next steps

Built-in rooms or those created with the Synthetic Environment Builder are ideal for development and testing, providing data for Passthrough, Scene, and Depth. However, if you only need Scene data, lightweight JSON-based rooms are an excellent choice. For more details, visit here.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon