releases/2.5.4releases/2.0.0releases/2.1.0releases/2.2.0releases/2.3.0releases/2.4.0releases/2.5.0releases/2.5.1releases/2.5.2releases/2.5.3
  • Features and Architecture
  • API Documentation

We've moved!

Starting from MRTK 2.6, we are publishing both conceptual docs and API references on docs.microsoft.com. For conceptual docs, please visit our new landing page. For API references, please visit the MRTK-Unity section of the dot net API explorer. Existing content will remain here but will not be updated further.

  • Features and Architecture
  • Feature Overviews
  • Spatial Awareness System
  • Spatial Awareness Overview
Search Results for

    Show / Hide Table of Contents
    • Welcome to MRTK
      • Installation Guide
      • Configuration
        • Using the Unity Package Manager
        • MRTK configuration dialog
        • Getting started with MRTK and XR SDK
      • Updates and Deployment
        • Updating from earlier versions
        • Upgrading from HTK
        • Building and Deploying MRTK
      • Packages and Release Notes
        • Release Notes
        • MRTK Packages
      • Performance and Best Practices
        • Performance
        • Hologram Stabilization
        • Using MRTK in large projects
    • Architecture
      • Overview
      • Framework and Runtime
      • Input System
        • Terminology
        • Core System
        • Controllers, Pointers, and Focus
      • Systems, Extension Services and Data Providers
    • Feature Overviews
      • Boundary System
        • Boundary System Overview
        • Configuring the Boundary Visualization
      • Camera System
        • Camera System Overview
        • Camera Settings Providers
          • Windows Mixed Reality Camera Settings
          • Unity AR Camera Settings [Experimental]
          • Creating a camera settings provider
      • Cross Platform Support
        • Configure MRTK for iOS and Android
        • Configure MRTK for Leap Motion Hand Tracking
        • Configure MRTK for Oculus Quest
      • Detecting Platform Capabilities
      • Diagnostics System
        • Diagnostics System Overview
        • Configuring the Diagnostics System
        • Using the Visual Profiler
      • Extension Services
        • Extension Service Creation Wizard
        • Scene Transition Service Overview
        • Hand Physics Service Overview
      • Input System
        • Input Overview
        • Input Actions
        • Input Events
        • Input Providers
          • Input Providers Overview
          • Creating an input data provider
        • Controllers
        • Eyes
          • Overview
          • Getting Started
          • Access Data via Code
          • Validate Tracking Calibration
        • Gaze
        • Gestures
        • Hands
        • How to Add Near Interaction
        • In-Editor Input Simulation
        • Pointers
        • Voice Input
          • Dictation
          • Speech (Command and Control)
      • Multi Scene System
        • Multi Scene System Overview
        • Scene Types
        • Content Scene Loading
        • Monitoring Content Loading
        • Lighting Scene Operations
      • Packaging
        • MRTK Packages
        • MRTK Modularization
      • Profiles
        • Profiles Overview
        • Configuration Guide
      • Rendering
        • MRTK Standard Shader
        • Material Instance Overview
        • Hover Light Overview
        • Proximity Light Overview
        • Clipping Primitive Overview
      • Services
        • What makes a mixed reality feature
        • What are the MixedRealityServiceRegistry and IMixedRealityServiceRegistrar
        • Extension services
      • Spatial Awareness System
        • Spatial Awareness Overview
        • Spatial Observers
          • Configuring Observers for Device
          • Configuring Observers for Editor
          • Controlling Observers via Code
          • Creating a custom Observer
      • Teleport System Overview
      • Tools
        • Dependency Window
        • Extension Service Creation Wizard
        • Holographic Remoting
        • Input Animation Recording
          • Input Animation File Format Specification
        • Migration Window
        • Optimize Window
        • Runtime tools
          • Controller Mapping tool
          • InputFeatureUsage tool
          • MixedRealityInteractionMapping tool
      • UX Building Blocks
        • Toolbox Window
        • Button
        • Bounds Control
        • Object Manipulator
        • Constraint Manager
        • Slate
        • System Keyboard
        • Interactable
        • Interactive Element
        • Solvers
          • Tap to Place
        • Object Collection
        • Scrolling Object Collection
        • Tooltips
        • Slider
        • Hand Menu
        • Near Menu
        • App Bar
        • Rigged Hand Visualizer
        • Fingertip Visualization
        • Progress Indicator
        • Dialog
        • Hand Coach
        • Pulse Shader
        • Dock Control [Experimental]
        • HoloLens Keyboard Helpers [Experimental]
        • Elastic System [Experimental]
        • Bounding Box [Obsolete]
        • Manipulation Handler [Obsolete]
      • Example Scenes
        • Examples Hub
        • Hand Interaction Example
        • Eye Tracking Interaction Example
    • Contributing
      • Contributing Overview
      • Coding Guidelines
      • Writing and Running Tests
      • Writing Documentation
      • Pull Requests
      • Experimental Features
      • Breaking Changes
      • How to use DocFX
    • Planning
      • Roadmap
    • Notice
    • Authors

    Spatial awareness

    Spatial Awareness

    The Spatial Awareness system provides real-world environmental awareness in mixed reality applications. When introduced on Microsoft HoloLens, Spatial Awareness provided a collection of meshes, representing the geometry of the environment, which allowed for compelling interactions between holograms and the real-world.

    Note

    At this time, the Mixed Reality Toolkit does not ship with Scene Understanding algorithms as originally packaged in the HoloToolkit. Scene Understanding generally involves transforming Spatial Mesh data to create simplified and/or grouped Mesh data such as planes, walls, floors, ceilings, etc. Starting from version 2.6 Scene Understanding is available as a experimental spatial observer called WindowsSceneUnderstandingObserver. However to use WindowsSceneUnderstandingObserver a separate package is needed. Please see the Scene Understanding page for more details.

    Getting started

    Adding support for Spatial Awareness requires two key components of the Mixed Reality Toolkit: the Spatial Awareness system and a supported platform provider.

    1. Enable the Spatial Awareness system
    2. Register and configure one or more spatial observers to provide mesh data
    3. Build and deploy to a platform that supports Spatial Awareness

    Enable the spatial awareness system

    The Spatial Awareness system is managed by the MixedRealityToolkit object (or another service registrar component). Follow the steps below to enable or disable the Spatial Awareness system in the MixedRealityToolkit profile.

    The Mixed Reality Toolkit ships with a few default pre-configured profiles. Some of these have the Spatial Awareness system enabled OR disabled by default. The intent of this pre-configuration, particularly for when disabled, is to avoid the visual overhead of calculating and rendering the meshes.

    Profile System Enabled by Default
    DefaultHoloLens1ConfigurationProfile (Assets/MRTK/SDK/Profiles/HoloLens1) False
    DefaultHoloLens2ConfigurationProfile (Assets/MRTK/SDK/Profiles/HoloLens2) False
    DefaultMixedRealityToolkitConfigurationProfile (Assets/MRTK/SDK/Profiles) True
    1. Select the MixedRealityToolkit object in the scene hierarchy to open in the Inspector Panel.

      MRTK Configured Scene Hierarchy

    2. Navigate to the Spatial Awareness System section and check Enable Spatial Awareness System

      Enable Spatial Awareness

    3. Select the desired Spatial Awareness system implementation type. The MixedRealitySpatialAwarenessSystem is the default provided.

      Select the Spatial Awareness System Implementation

    Register observers

    Services in the Mixed Reality Toolkit can have Data Provider services that supplement the main service with platform specific data and implementation controls. An example of this is the Mixed Reality Input System which has multiple data providers to get controller and other related input information from various platform-specific APIs.

    The Spatial Awareness system is similar in that data providers supply the system with mesh data about the real-world. The Spatial Awareness profile must have at least one Spatial Observer registered. Spatial Observers are generally platform specific components that act as the provider for surfacing various types of mesh data from a platform specific endpoint (i.e HoloLens).

    1. Open or expand the Spatial Awareness System profile

      Spatial Awareness System Profile

    2. Click the "Add Spatial Observer" button

    3. Select the desired Spatial Observer implementation type

      Select the Spatial Observer Implementation

    4. Modify configuration properties on the observer as necessary

    Note

    Users of the DefaultMixedRealityToolkitConfigurationProfile (Assets/MRTK/SDK/Profiles) will have the Spatial Awareness system pre-configured for the Windows Mixed Reality platform which uses the WindowsMixedRealitySpatialMeshObserver class.

    Build and deploy

    Once the Spatial Awareness system is configured with the desired observer(s), the project can be built and deployed to the target platform.

    Important

    If targeting the Windows Mixed Reality platform (ex: HoloLens), it is important to ensure the Spatial Perception capability is enabled in order to use the Spatial Awareness system on device.

    Warning

    Some platforms, including Microsoft HoloLens, provide support for remote execution from within Unity. This feature enables rapid development and testing without requiring the build and deploy step. Be sure to do final acceptance testing using a built and deployed version of the application, running on the target hardware and platform.

    Next steps

    After following the procedures above to enable the Spatial Awareness system, the system can be configured and controlled in more detail.

    Information for configuring observers in inspector:

    • Configuring Observers for on device usage
    • Configuring Observers for in-editor usage

    Information for controlling and extending observers via code:

    • Configuring Observers via Code
    • Creating a custom Observer

    See also

    • Spatial Awareness API documentation
    • Spatial Mapping Overview WMR
    • Spatial Mapping in Unity WMR
    • Improve this Doc
    In This Article
    • Getting started
      • Enable the spatial awareness system
      • Register observers
      • Build and deploy
    • Next steps
    • See also
    Back to top Generated by DocFX