Augmented reality just draws overlays on top of a camera feed. Mixed reality has to hide a hologram behind real furniture, which needs a per-ray depth test:
show hologram sample only if t_virtual < t_real + ε
This 2D version replaces the 3D fragment shader with an explicit polar depth buffer: a fixed-position camera fans out 181 rays across its field of view, each ray solved analytically against the room's rectangles and the pillar's circle (slab method and quadratic ray/circle intersection) to get a clean ground-truth distance t_real. A separate, coarser array of "sensor beams" (as few as 4) is nearest-neighbour-upsampled back to all 181 rays and pushed by a fixed per-ray noise offset ε, mimicking a real depth camera's limited resolution and measurement error. The hologram's own distance t_virtual is solved the same way against its disc. Comparing t_virtual to the clean rays gives ground truth; comparing it to the degraded sensor rays gives what a real headset would actually render.
- Depth into room — moves the hologram disc further from the camera along the view axis; push it behind the couch, pillar or bookshelf to see rays flip from purple (visible) to red (occluded).
- Sensor resolution — the number of independently-measured beams (4–181). Below 181 the sensor's real-depth curve is stepped and nearest-neighbour upsampled, exactly like a low-res depth texture sampled at full screen resolution — occlusion edges turn blocky.
- Sensor noise — adds a fixed per-ray offset ε to the sensor's comparison, mimicking depth-sensor measurement error; it never changes over time (matching a real static noise texture), only which rays it affects changes as the hologram or camera moves.
- Occlusion toggle — turns the depth test off: the hologram then draws regardless of the sensor result, exactly like a naive "always on top" AR overlay.
- Drag the map — rotates the camera's view direction (a 2D stand-in for orbiting), sweeping the ray fan across the room without moving any furniture.
- Ground truth vs sensor — the two bottom readouts are computed independently: ground truth uses all 181 rays at full precision with zero noise; the sensor readout uses whatever resolution/noise you've dialled in. The gap between them is the sensor's real-world error.