Spatial Mesh do not show in hololens2 emulator

Viewed 460

I'm using Hololens 2 emulator version 10.0.19041.1157
MRTK version 2.6.1
Unity Version 2020.1.0a12.1360
Windows 10 64bit

In unity, i can see example mesh loaded from spatial mapping data ["MixedRealityToolkit" GameObject ->Spatial Awareness -> Spatial Objet mesh Observer -> Type ->SpatialObjectMeshObserver].
I have attached a script to Gameobject that draws lines on this spatial mapping as attached in screenshot below

void Start()
{
    IMixedRealitySpatialAwarenessSystem spatialAwarenessSystem;
    spatialAwarenessSystem = CoreServices.SpatialAwarenessSystem;
    spatialAwarenessSystem.ResumeObservers();
}

![[inserted screenshot from unity]

while building the app to hololens in unity, i'm setting the value
["MixedRealityToolkit" GameObject ->Spatial Awareness -> Spatial Objet mesh Observer -> Type ->WindowsMixedRealitySpatialMeshObserver]

I have enabled "SpatialPerception" under Player Settings->Publishing Settings->Capabilities.

There are no build errors, App Deployment from Visual Studio to Hololens emulator is successful [x64, Release]
Note: i have loaded default room in emulator.

upon app start, i don't see spatial mesh in emulator like i used to see in unity.
although i can see spatial mesh in webportal of emulator as shown in below screenshot.

![inserted screenshot from browser with mesh

1 Answers

First, we always recommend the latest MRTK version as the best version to develop the MR app, and the current recommendation is to use MRTK 2.7.2. Please review the Upgrade Guide for guidance on how to upgrading your project.

For the Spatial Mesh does not visible in Hololens2, Spatial Observers are platform-specific components that act as the provider for surfacing various types of mesh data from a platform-specific endpoint. Therefore, please select the WindowsMixedRealitySpatialMeshObserver class which supports the HoloLens2 platform and modify configuration properties on the observer as necessary:Configuring mesh observers for the device

Related