Skip to content

*Terrible* sample code for getting screen contents in Unity on Meta Quest as a scuffed alternative to 'camera access'

License

Notifications You must be signed in to change notification settings

victorjunaidy/QuestDisplayAccessDemo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quest Display Access Demo

Developers want camera access on the Meta Quest. Meta hasn't let us have it yet. The next best thing is display access. Thanks to Android's MediaProjector API, you can copy the display image to a texture in your Unity project in 'near realtime' (several frames of latency) as demonstrated in this horribly architected Unity project. No PC, embedded browser, or dev mode required

apriltag demo

Demo from AprilTagDemo scene

⚠️ Issues (please read)!

To fix

⚠️ This demo project only creates a single MediaProjector session on app launch. If the app is interrupted (such as by the headset going to sleep) the session will end and you'll need to restart the app.

Gotchas

⚠️ You may need to be on Quest system software v68 or higher

⚠️ This only works on-headset. This will not work through QuestLink

⚠️ You cannot video record the display 'normally' while this app's MediaProjector session is running. You can instead use scrcpy to record any prototypes or demos you make with this.

⚠️ This still isn't proper camera access. Any virtual elements will obscure physical objects in the image. If you need to track something, you must not render anything on top of it!

Other info

  • The captured view is ~82 degrees in horizontal and vertical FOV on Quest 3
  • The capture texture is 1024x1024, at least on Quest 3
  • The left eye buffer is where captured frames come from
  • Quest system camera settings do not affect the capture resolution, framerate, or eye side

Reference

About

*Terrible* sample code for getting screen contents in Unity on Meta Quest as a scuffed alternative to 'camera access'

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • ShaderLab 73.2%
  • HLSL 12.1%
  • C# 8.7%
  • Java 6.0%