Unity sample project for Quest passthrough camera access
Top 83.9% on SourcePulse
This project provides Unity developers with sample code and helper classes to access and utilize the passthrough camera feed on Meta Quest devices. It targets developers building mixed reality experiences who need to integrate real-world camera data into their Unity applications, offering functionalities like displaying the feed, performing computer vision tasks, and applying visual effects.
How It Works
The project leverages Unity's WebCamTexture
class to access the Quest's passthrough camera, abstracting the underlying Android Camera2 API. It includes manager classes for handling permissions, initialization, and retrieving camera metadata. Sample scenes demonstrate converting 2D image coordinates to 3D world space using camera intrinsics and poses, integrating with Unity Sentis for on-device ML/CV inference, and applying custom GPU shaders to the camera feed.
Quick Start & Requirements
git clone https://github.com/oculus-samples/Unity-PassthroughCameraApiSamples
. Ensure Git LFS is installed (git lfs install
).android.permission.CAMERA
, horizonos.permission.HEADSET_CAMERA
.Highlighted Details
Maintenance & Community
The project is maintained by Meta. Further community interaction details are not explicitly provided in the README.
Licensing & Compatibility
The Oculus License applies to the SDK and supporting materials. The MIT License applies to specific, marked files (e.g., models in SentisInference/Model
). Commercial use is generally permitted under the Oculus License, but specific restrictions may apply.
Limitations & Caveats
The WebCamTexture
implementation has limitations, including single camera access at a time and a slight delay (40-60ms) due to missing timestamps. The maximum supported resolution is 1280x960, with potential cropping. Concurrent permission management with other systems may cause conflicts. The object detection model has known accuracy limitations and class granularity issues. Meta XR Simulator and Meta Link are not supported.
2 months ago
Inactive