I’m porting a legacy ARKit Plugin based project to the latest MARS. What I did in the old system was access the camera background textures and manually build a reflection map of it (cheap but efficient).
How can I access the Camera Image in MARS?
The new XR camera subsystem promises to provide a camera image, but I don’t even know how to get this instance ^^. I’d prefer the “external” GPU texture btw.
An alternative solution would be to use ARKit’s environment probes instead. How is this done with MARS?
this.GetCameraTexture()
("this" is necessary because GetCameraTexture is an extension method for IUsesCameraTexture).
At runtime on device this will return the camera texture provided by AR Foundation. In simulation in the editor it will return the texture of the video in "Recorded" mode or the webcam in "Live" mode. In other simulation modes it returns null.```
Hi @tteneder , this is a bug with our camera texture provider implementation for AR Foundation. We will make sure to fix this as soon as possible.
In the meantime you can grab the camera image directly from the ARCameraManager, which you can get from the active MARS camera game object: MarsRuntimeUtils.GetActiveCamera(true).GetComponent<ARCameraManager>()