MRUK’s high-fidelity room mesh, which provides detailed 3D geometry with per-face semantic labels. Unlike standard Scene API data that represents rooms as bounding boxes and planes, the high-fidelity mesh exposes complete vertex and triangle data where each face carries a semantic label (floor, ceiling, walls, doors, and windows).MRUK room, including vertices and indexed triangle facesMRUK SDK installedMRUK setup guide.| File / Scene | What it demonstrates | Key concepts |
|---|---|---|
HiFiScene.unity | Scene configuration with MRUK prefab configured for high-fidelity mesh loading from JSON | MRUK DataSource configuration, EnableHighFidelityScene flag, RoomMesh GameObject structure |
Scripts/RoomMesh.cs | Complete workflow for retrieving, processing, and rendering the room mesh with semantic-based materials | Event subscription, mesh construction, submesh-per-face architecture, semantic label mapping |
Rooms/InnerWalls.json, MultiCeiling.json, MultiFloor.json, SlantedCeiling.json | Four test room configurations with varied geometry (inner walls, multiple floor/ceiling planes, and slanted surfaces) | JSON scene data format with roomMeshMETA section containing base64 vertex data and indexed faces |
MRUK loads room data from one of the configured JSON files with high-fidelity mesh enabled. The RoomMesh script subscribes to the scene load event, retrieves the mesh data, and constructs a Unity mesh where each face becomes a separate submesh. The renderer applies color-coded materials based on semantic labels: floors render in green, ceilings in light gray, standard walls in blue, inner walls in darker blue, invisible walls in purple, door frames in brown, and window frames in light blue. The mesh renders slightly offset (1.001x scaling from its centroid) to prevent z-fighting with other room geometry.MRUK’s SceneLoadedEvent to retrieve room data asynchronously. RoomMesh.cs subscribes in Start() and accesses MRUK.Instance.GetCurrentRoom().RoomMeshData when the event fires. The RoomMeshData property is nullable; the sample checks for null before accessing .Value to retrieve the vertex and face collections.Faces.Count, then iterates through each face to populate its triangle indices via mesh.SetTriangles(face.Indices, submeshIndex). This architecture allows the renderer to apply distinct materials based on face.SemanticLabel while keeping a single shared vertex buffer across all faces. See the CreateMeshFromRoomMeshData method in RoomMesh.cs for the full implementation.MRUKAnchor.SceneLabels enum value to a specific color and creates a material using the Universal Render Pipeline’s Lit shader. The SceneLoadedEvent handler builds an array of materials matching the face order, where floor faces receive green (0.2, 0.6, 0.2), wall faces receive blue (0.6, 0.6, 0.8), and so on. This color coding reveals the structure of the semantic mesh, showing how MRUK distinguishes between outer walls, inner partition walls, and architectural features like door and window frames. See the switch statement in RoomMesh.cs for the complete color mapping.