v147 · WebXR · AR

WebXR Plane Detection API

Chrome 147 ships the WebXR Plane Detection API, letting AR web apps retrieve the set of real-world planes — floors, walls, tables — detected by the device. Unlike depth-based detection, plane detection surfaces semantic geometry that remains coherent even when objects occlude part of a surface.

concepts

  1. Capability Inspector

    Check whether this browser and device support WebXR plane detection. Shows how to query for the plane-detection optional feature, inspect the resulting XRPlane objects, and read their orientation and polygon properties.

  2. Plane Visualizer

    A 2D simulation of a plane-detection AR session — see how the API surfaces horizontal and vertical planes as polygon meshes, how plane geometry updates frame-by-frame, and how to overlay content anchored to a detected surface.

  3. Plane Polygon Inspector

    Select a simulated detected plane and inspect the raw XRPlane.polygon vertex data — a DOMPointReadOnly[] convex hull. Hover a vertex to highlight it in the overhead 2D view. Shows area, bounding box, and axis orientation for each plane shape.

  4. AR Surface Mapper

    Top-down 2D map of a simulated room showing detected planes as coloured polygons. Click planes to inspect their XRPlane attributes, toggle a confidence heat map, and snap virtual AR objects to selected surfaces at clicked positions.

  5. Compatibility Lab

    Probes all five WebXR plane detection globals — XRPlane, XRPlaneSet, XRFrame.detectedPlanes, navigator.xr presence, and immersive-ar session support. Runs isSessionSupported() live and provides the graceful-degradation pattern for browsers without plane detection.

why it shipped

Augmented-reality web apps need to understand the physical world to place virtual content correctly — a virtual lamp should sit on a real table, a navigation overlay should align with a real floor. The existing WebXR Depth Sensing module exposes raw depth values, but those are noisy and fragmented when objects occlude a surface: the depth map shows the object, not the wall behind it. The Plane Detection API is complementary: when the device's tracking system recognises a plane (floor, wall, table-top, ceiling), it surfaces a clean polygon representing the surface boundary plus a semantic label — horizontal or vertical. Developers opt into this feature by requesting plane-detection in the optional features list when creating an immersive-ar session. Each animation frame then provides an updated XRPlaneSet through XRFrame.detectedPlanes, with each XRPlane carrying a pose, an orientation, and a bounding polygon in its own coordinate system.

references