demo · v139
Depth Sensing Latency
Depth-sensing data is delivered with lower latency in v139. AR apps using occlusion or scene understanding get fresher samples per frame. Probe XR support, then run the simulated render loop to compare pre/post latency.
WebXR depth sensing requires an AR-capable device (e.g. Pixel + ARCore). On desktop we run a simulated loop so you can see the latency budgets visually.
Click "Probe" to feature-detect.
pre-v139 latency
—
ms (depth sample age)
v139 latency
—
ms (depth sample age)
the code
const session = await navigator.xr.requestSession("immersive-ar", {
requiredFeatures: ["depth-sensing"],
depthSensing: { usagePreference: ["cpu-optimized"], dataFormatPreference: ["luminance-alpha"] },
});
const refSpace = await session.requestReferenceSpace("local-floor");
session.requestAnimationFrame(function onFrame(t, frame) {
const view = frame.getViewerPose(refSpace).views[0];
const depth = frame.getDepthInformation(view);
// v139: depth.data arrives with materially lower latency
session.requestAnimationFrame(onFrame);
});