MR recording shows black background in Cesium scene

Give us as much detail as possible regarding the issue you’re experiencing:

Unity Editor version: 2022.3.21f1
ML2 OS version: 1.5 (using OpenXR)
MLSDK version: 2.5.0

I’m using the Unity ML Examples 1.5 screen capture script to record Mixed Reality (MR) videos in my Unity application on Magic Leap 2.

Recording works correctly in most scenes. However, in one scene that uses Cesium for Unity, the MR portion of the recording (1440×1080 area) shows a black background instead of the real world. The Cesium map renders correctly, but the background behind it is solid black in the recorded video.

Important details:

  • Cesium uses its own camera.

  • I attempted to set the camera background alpha to 0 in the Inspector.

  • After building and deploying, the alpha value resets to 255.

  • If I use the ML2 Video Recorder tool and manually reduce the opacity below 0, the recording works correctly and the background shows the real world as expected.

My question:

Is there a way to programmatically set the recording camera’s opacity (alpha) below 0 at runtime so the MR capture includes the real-world background correctly?

Or is there a specific configuration required when using Cesium’s camera with Magic Leap’s MR recording pipeline?

Any guidance would be greatly appreciated.

Hey @gregkoutsikos ,

I think what’s going on here is that Cesium is overriding the camera configuration at runtime or during initialization. Cesium’s own camera is managed and certain properties are set at runtime. That’s why setting the property in the inspector doesn’t work, because Cesium overrides it later.

Try to ensure that the camera background is set to Solid Color and background color is (0,0,0,0) at runtime via a script that sets these properties after Cesium has applied it’s configuration at runtime. You can try doing this in a LateUpdate().

If that ends up working for you, you can try to find a better/alternate solution that prevents Cesium from setting these properties at runtime, like creating your own camera setup but using XR Rig as your base camera instead of Cesium’s default Camera.

Best,
Corey