Masking issue in unity example

I was following the tutorial posted on this doc link "XR Hand Interaction Demo | MagicLeap Developer Documentation" for setting up hand interaction demo.

The demo sets up and runs as expected. But the UI Scroll view that I see on my glasses is not masked properly. Although when I click a picture through the ML2 camera, the masking in those images is shown correctly (I have attached two images for clarity, first one shows "what the camera captures" and the second one shows what I as a user see through the glasses)


Unity Editor version: 2022.3.16f1
ML2 OS version: 1.11.0
Unity SDK version: XR Interaction Toolkit 2.5.2
Host OS: Windows

Error messages from logs (syntax-highlighting is supported via Markdown):
There are no bugs I could log.

Hi @Harsh_Vardhan_Singh,

Are you using Unity's Universal Render Pipeline in your project?

If not, that may be the cause of your issue.

If so, would you mind sharing a screenshot of the Masking GameObject in your heirarchy?

Yes, I am using The "Universal Render Pipeline" with the HDR switched off and shadow last border set to 5, the rest is the default settings of the URP.

The whole scene is a demo scene from "XR Interaction Toolkit -> Hand Interaction Demo". I have attached the image of the masking object as well

I remember, I tried to make another scroll view in a project few weeks back for ML2 and even that had the masking issue.

Given that when I am clicking a photo from the magic leap 2 device the masking is proper in the capture but it is not working when I see it on the glasses, could it be an issue with how masks are rendered on the see through screen?

Thankyou for the support.

Hmm! I'm not able to replicate this issue unfortunately. Would you mind trying this out in the Magic Leap example Unity Project provided with the SDK?

What is your Project Settings > OpenXR > Depth Submission Mode set to?

  1. I looked at the provided sample project by ml2 as well. There were no masking examples so I do not know If the problem occurs there as well. I could check for this by next week.
  2. The depth is set to "Depth 16 Bit"

But I really think this is not a set up problem because, the masking does not works when I viewing the application in real time but when i click an image of the same, we can see that the mask works properly.

Can you confirm looking at a dropdown menu through the glasses? If you add a dropdown and populate it with a lot of options (15-20 options). When you open the dropdown in the glasses you will see that the options are overflowing unlike if you see it on editor.

Would you mind sharing a minimal project to reproduce this issue?

What are you using to capture the image?

You can use the setup in this doc:

If you do not see similar masking issue in the scroll panel in front of you, then it was probably some setup blunder from my side. Although the issue is not causing great hinderance, so I have kept it aside for the time being.

I used the picture camera to capture the image but that shows the mask correctly there. So to show the issue I actually shot an image of the see through lens of the ML2 device from my mobile.

In your URP Settings is "Depth Texture" enabled?

Would you mind cross checking your renderer settings with these? Particularly the depth texture mode?

No, it was unchecked. I enabled it and rebuilt the application and it seems to work. Thank you for the assistance!

1 Like