Meshing
Meshing is the creation of triangle-based meshes surfaces detected by Magic Leap devices. The mesh is used for real-time occlusion rendering and collision detection with digital content. Unlike Plane Detection, which only detects planar surfaces, Meshing can detect a variety of surfaces.
Mesh Blocks
Mesh Blocks are sections of the mesh that spatially subdivide the real world into a set of cubic blocks that are updated from the internal reconstruction model. The geometry contained in these cubical regions of the reconstruction is represented as a connected triangle mesh (i.e. a mesh where vertices are shared by multiple triangles).
- Local Updates
- Meshes between blocks are not connected. This enables fast, localized mesh updates when changes occur in one area of the environment. This also helps when objects move to new locations.
- Mesh Block Skirt
- A small "skirt" region is added to Mesh Blocks so that they overlap neighboring blocks by a small amount. This provides continuity, fills small cracks, and provides a more visually continuous surface for occlusion and physics.
Developers are strongly recommended to use the Meshing Subsystem component to obtain mesh information. This component manages all the necessary calls between Magic Leap Meshing and Unity's XRMeshSubsystem
.
This feature requires the SPATIAL_MAPPING
permission to be enabled in your project's Manifest Settings. (Edit > Project Settings > Magic Leap > Manifest Settings)
Surfaces that are reflective or have little texture may not be detected properly.
📄️ Meshing Subsystem Component Overview
Learn how the Meshing Subsystem component works and it's features.
📄️ Meshing Visualizer Example
Learn to adjust the appearance of the mesh generated by the Magic Leap 2.
📄️ Meshing Query Location Example
Learn how to adjust the mesh queries location and bounds.
📄️ Simple Meshing Setup
In this tutorial, you'll learn how to set up the Spatial Mapping component with Magic Leap 2 in Unity. By the end of this guide, you'll have a scene capable of meshing the world around you, providing a foundation for immersive mixed reality experiences. The Spatial Mapping in Magic Leap 2 is similar to AR Foundation's Spatial Mapping component.
See also
UnityEngine.XR.XRMeshSubsystem
- XRMeshSubsystem API to which Magic Leap provides it's meshing information.
UnityEngine.XR.MagicLeap.MeshingSubsystemComponent
- API Reference for the MeshingSubsystemComponent.