Labs

Depth Map

Your webcam, a depth AI running on your device and an orb of light you can pinch.

The depth model (about 20–50 MB) downloads once. Video never leaves your device.

Arrow keys move the orb, Page Up / Page Down change its distance, D toggles the depth map.

How it works

Each camera frame goes to Depth Anything V2 Small, run locally by ONNX Runtime Web on WebGPU (or WebAssembly) in a worker. It returns relative depth for every pixel.

The shader turns that depth into 3D positions and surface normals, then lights the image from the orb: inverse-square falloff, a short ray march for shadows, and the orb hides behind anything nearer than it.

Drag the orb or pinch it with MediaPipe Hand Landmarker. When you hold it, it follows your hand’s depth. Use the wheel or the Distance slider to push it into the room.