static class Sensor.Depth
Provides access to real-time depth sensing from the device, if available. Depth data is provided as a GPU texture with per-frame metadata including camera intrinsics and view/projection information for each eye.
This is currently backed by XR_META_environment_depth on OpenXR backends. If no depth provider is available, calls will gracefully return false or no-op.
Static Fields and Properties
| bool IsAvailable | True when the depth system is available on the current device and backend. |
| bool IsRunning | True while the depth provider is actively running. |
| Tex Texture | The system-managed depth texture. Available once the depth sensor has been started. Dimensions and format are valid after the first frame. |
Static Methods
| GetCapabilities | Returns a bitmask of SensorDepthCaps indicating which optional features are supported on the current platform and backend. |
| SetCapabilities | Updates the active capabilities while the sensor is running. Can enable or disable features like hand removal or CPU readback at runtime. Unsupported capabilities are silently ignored. |
| Start | Starts the depth provider with the given capabilities. Unsupported capabilities for the current platform are silently ignored. Must be called before TryGetLatestFrame will return data. |
| Stop | Stops the depth provider. |
| TryGetLatestData | Retrieves the latest CPU-accessible depth data with matching per-eye metadata. The readback pipeline starts automatically on the first call and runs asynchronously, so the first few calls may return false. The returned data is typically 1-2 frames behind the GPU texture, but can be more under heavy GPU load. |
| TryGetLatestFrame | Retrieves the latest per-frame depth metadata. |
Found an issue with these docs, or have some additional questions? Create an Issue on Github!