Detected plane comes on and off

Include the following details while filing a bug report (edit as applicable):

  • Device type & OS version: iPhone 11 Pro on iOS 15.5
  • Host machine & OS version: Mac on Monterey
  • Issue Environment : On Device
  • Xcode version: 13.4
  • ARDK version: 2.0
  • Unity version: 2022.1.1f1

Bug reproduction steps:
I implemented occlusion in our project and the detected plane flickers. I saw this related issue that talks about possible causes of the issue. So what I did is start from scratch and I actually followed the Occlusion tutorial. I also made some changes based on the tips given here. However, the detected plane still flickers as you can see here. That results to my object going away and showing back in.

Hello Voltaire,

Would you be able to share the processor your Mac runs on? Would it be an M1 Mac or an Intel Mac?

Lastly, I noticed you said you’re on Unity 2022 which is not officially supported by ARDK at the moment. I checked out the forum post you linked and saw that they were running Unity 2021. If you have not tried using an earlier version, like the user in that post did, can you try doing so?

I would recommend trying Unity 2020.3 if you’re on an Intel Mac because it’s the latest Unity version that ARDK supports. If you’re on M1, I would recommend 2021. Although not officially supported, some M1 users have preferred using 2021 since it no longer requires them to apply our M1 patch, and there have not been any serious compatibility issues reported as of yet.

I will also include the link to the M1 patch for version 2020.3 in case you’d like to try it with a supported version:

Running on Mac mini M1, 2020

I switch the project to 2021.3.5f1 but it did not help. To eliminate the downgrade as a factor, I created a new simple project and still using 2021.3.5f1. I tried running first without the “AR Semantic Segmentation Manager” and adding it in. In both scenario I’m still seeing a flickering of the detected plane.

Looks like I solved my issue and noticed some interesting behaviors:

  1. Without occlusion, setting the Interpolation to Smooth for the ARDepthManager causes the flickering of the detected plane. This causes the spawned objects on the plane to flicker as well (hide/show). I use Balanced to solve this issue and my objects stay where they are.

  2. With occlusion (which is what we need), using Balanced is enough but I wanted to try the Smooth interpolation. This is possible with the use of ARSemanticSegmentationManager. What I missed from the guide though is adding a suppression channel. I added “ground” and it fixed my issue.

In Summary:
NG = Not good, with flicker, object goes away
OK = stable, no flicker, object is always visible

  • No Occlusion + Smooth interpolation = NG
  • No Occlusion + Balanced = OK
  • Occlusion + Balanced = OK
  • Occlusion + Smooth = NG
  • Occlusion + Smooth + ARSemanticSegmentationManager with suppression channel = BEST

I just realized that if I don’t use the Screen Space Mesh then I won’t be able to take advantage of the mesh occlusion even if I have ARSemanticSegmentationManager. I’ve been testing and I can’t see much of the difference between the two modes. Doing more tests…

Hi Von,

Thanks for providing this information, please provide any other information you find in your testing. We are still looking into this issue and will be getting back to you as soon as possible.

Hi Von,

Thank you for your patience. After looking into this issue and discussing with our developers, this is a known issue that is currently being addressed and will be improved in a future release of ARDK.

This happens due to the depth height that is calculated and the depth texture not being able to agree on a proper depth. The worst case for this issue is pointing the camera straight down which is likely due to a lack of perspective causing everything to seem flat.

The best workaround for this at the moment is one you already outlined; by using the suppression channel.

Thanks for the update Jesus. I’m glad to know that your team encounters it too and improving it.

I’ll stick to the workaround for now. And yes, I’ll send you more findings as I do more tests.