Unity ML2 rendering flickering URP

Unity Editor version: 2022.3
ML2 OS version: 1.8
Unity SDK version: 2.5.0
Host OS: Windows

Application builded with unity.

Used normal Shaders and no flickering problem occured.

After started using URP flickering problem occurs after the following condition.

Flickering Issue Description:

The problem manifests as intermittent but severe screen flickering in my Unity URP application on Magic Leap 2, which was never present when using the Standard Rendering Pipeline.

Potential Triggers (Not consistently reproducible):

  • Sometimes occurs after application restart
  • Sometimes occurs after tracking loss events
  • Sometimes occurs when activating the ML2’s native photo/video capture bar

Behavior When Flickering Occurs: When the issue manifests, a specific viewing angle becomes a “dead zone” where:

  • Looking directly at this point: Unity rendering disappears completely
  • Looking slightly away (roughly 30°): Screen aggressively flickers on/off multiple times per second
  • Looking further away (roughly 60°+): Rendering returns to normal with no flickering

The dead zone looking angle stays fixed once the problem begins. In rare cases when triggered by the photo/video capture interface, pressing the X on that bar might resolve it. Otherwise, the only solution is to close and restart the application.

This issue is difficult to reproduce.

Key Insight: The flickering issue only occurs when Magic Leap 2 adds its own UI elements (like tracking loss notifications or photo/video capture interface) on top of the Unity URP application. The problem never happens during normal operation without these ML2 system overlays. This suggests a specific incompatibility between URP and ML2’s system rendering layer interactions, which didn’t exist with the Standard Rendering Pipeline.

I recommend trying to use the same URP configuration that is included in the Magic Leap Examples project to make sure that the configuration is valid. Based on your description it sounds like all of the OpenXR settings remained constant between URP and the standard render pipeline which leads me to believe that updating those settings alone would fix the issue.

You mean this doc? Render Pipeline Settings | MagicLeap Developer Documentation

You can look at the exact settings in the Magic Leap Unity Examples project that can be downloaded through the ML Hub