We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.
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.
The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.
On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.
So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. 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.