Magic Leap 2 (OpenXR/Unity): Selective (Per-Object) Segmented Dimming Support?

Unity Editor version: 2022.3.56f1
ML2 OS version: v1.12.0
Unity SDK version: 2.6.0
Host OS: Windows

We’re developing a Magic Leap 2 experience in Unity, and we want to use Segmented Dimming selectively on specific objects only, rather than applying it globally.

We found this guide:
https://developer-docs.magicleap.cloud/docs/guides/unity/display/unity-segmented-dimming/

However, it appears to be based on the legacy MLSDK / Magic Leap XR Plugin workflow (e.g., MLSegmentedDimmer.Activate()). We understand that MLSDK is no longer the recommended/active path, and our project uses the OpenXR-based Unity stack.

Could you please clarify the following:

  1. In the current OpenXR + Unity pipeline on ML2, is object-level selective Segmented Dimming officially supported?

    • If yes, what is the recommended implementation approach (e.g., mask meshes, render layers, URP Renderer Feature, etc.)?
  2. If OpenXR only supports Segmented Dimming at a frame/global level (e.g., via rendering blend mode), then for “selective application,” is the only practical method to build the dimming mask by writing to the alpha buffer for selected objects only (an alpha-only pass)?

Thank you

The Magic Leap 2 OpenXR SDK uses the dimmer based on the alpha buffer of the final image. While we do not provide an example of this, you may be able to get per-object dimming by modifying the Unity Render Pipeline to clear/add the alpha buffer selectively. However, this might be a very large undertaking.

While changing this feature to support per-object dimming is not currently on our pipeline. I will forward this request to our voice of customer team and mark it as a feature request.