demo · v139
Raw vs Smooth
v139 lets WebXR sessions request the raw or smoothed depth buffer per frame, and start/stop the runtime's depth pipeline mid-session. Pick the mode and watch a simulated depth render: raw is noisier and faster, smoothed is cleaner and costlier. Either way you save the frames where depth isn't needed.
Live WebXR sessions need a headset. This page simulates the two depth buffers on a synthetic scene so the cost / quality tradeoff is interactive everywhere. The WebXR API call shape is shown below.
scene (RGB)
depth buffer (false-colour)
—
depth fps
—
per-frame cost (rel.)
—
noise floor
the code
const session = await navigator.xr.requestSession("immersive-ar", {
requiredFeatures: ["depth-sensing"],
depthSensing: {
usagePreference: ["gpu-optimized"],
dataFormatPreference: ["luminance-alpha"],
depthType: "smooth", // v139: request raw or smooth
},
});
// v139: start / stop runtime depth mid-session to save power
session.pauseDepthSensing(); // when entering a UI menu
session.resumeDepthSensing(); // when leaving