The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Access the RGB camera (or Locatable Camera) at 30fps?
Does anyone know how to access the RGB camera (or Locatable Camera) at 30 frames per second in Unity? I've already tried these approaches without success:
- Call PhotoCapture.TakePhotoAsync on each Update() frame.
- Use Unity's WebCamTexture.
I didn't measure the framerate for the first one but it was probably around 5-10fps. Using WebCamTexture with an 896x504 image, I was able to get around 20fps. I can think of only 3 other options right now:
- Call PhotoCapture.TakePhotoAsync with InvokeRepeating (similar to this blog post), but I'm assuming that this will still be too slow.
- Bypass Unity's web camera functions and try to directly access the camera, perhaps by using one of the Windows Universal Samples.
- Wait until Unity's wrapper for LocatableCamera has a function to do this. Does anyone know if Unity is planning to implement this?
- By just calling play() on a WebCamTexture, the framerate drops from 60fps to 20fps! That is, I'm not doing any extra processing with the WebCamTexture; I'm only calling play().
- A downside of using WebCamTexture is that it doesn't give you the position or rotation of the camera for that frame, unlike using LocatableCamera. I suppose a possible remedy is to find the rigid transformation between Camera.main.transform and the transform given by LocatableCamera.