Unity Hololens2 development | (2) MRTK3 import and configuration

1. Start with the MRTK3 template project

  • The easiest way to get and try MRTK3 is to get the project on Github. This project contains references to all current MRTK3 packages and is preconfigured with the project settings required for deployment to devices. Clone the project in the GitHub repository and checkout the mrtk3 branch. Afterwards, just launch the Unity (2021.3.21f1 or later) MRTKDevTemplate under UnityProjects and start playing the sample scene in the editor by using remoting or deploying to a device.
  • If you're working with Git from the command line, you can clone the repository while specifying the mrtk3 branch:

git clone --branch mrtk3 https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity.git

2. Start with a new project

2.1 Create a new Unity project

Create a new Unity project using Unity 2021.3.21f1 or later. Close the Unity project before proceeding to the next step.

2.2 Use the Mixed Reality Function Tool to import the required dependencies and MRTK3 packages

2.3 Open the Unity project

  • Open the Unity project and wait for Unity to finish importing the newly added package. During this process, two pop-up messages may appear:
    1. The first message asks if you want to enable the new input backend. Select "Yes".
    2. The second message asks whether to update the XR InteractionLayerMask. Select "No, thank you."
  • Unity may restart several times during this process, please wait for it to complete before continuing.

2.4 Configure the MRTK configuration file after importing

  • Navigate to Edit >ProjectSettings.
  • Navigate to "MRTK3" under "Project Settings" and search directly in the search box.
  • Populate the fields using the default MRTK configuration file shipped with the core package. You can type the keyword "MRTKprofile" in the search bar of the project window; be sure to search in All. Alternatively, you can find the profile under Packages/org.mixedrealitytoolkit.core/Configuration/Default Profiles/MRTKProfile.asset .
    1

2.5 Configure OpenXR related settings

  • Under Edit >ProjectSettings, navigate to XR Plug-in Management and enable OpenXR under the window and UWP tabs. Under each tab make sure "Initialize XR on startup" is checked, and make sure the "Windows Mixed Reality feature group" under the "Windows" tab and the "Microsoft HoloLens feature group" under the "UWP" tab are enabled.
    1
    2

Removal Warning:
You may need to use the OpenXR Project Validation tool to eliminate the yellow triangle. Some warnings can be resolved manually:

  1. Under Project Setting, navigate to Player > Resoution and Presetation. Make sure "Run in Background" is unchecked.
  2. For UWP, under Player>Publishing Setting> make sure to check WebCam, Microphone, SpatialPerception, and GazeInput if your application requires these features.
  • Under Project Settings, navigate to XR Plug-in Management >OpenXR >Interaction Profiles and add the following three profiles for UWP and Window: a> ● Eye Gaze Interaction Profile (eye gaze interaction profile) ● Microsoft Hand Interaction Profile (gesture interaction profile)
    ● Microsoft Motion Controller Profile (motion controller profile)


    1
    2
  • For HoloLens 2, it is recommended to set Deep Commit Mode to 16-bit in the settings above. For immersive headsets, 24-bit depth submission is available.

2.6 Using template project resources

おすすめ

転載: blog.csdn.net/backlighting2015/article/details/133925532