Search Unity

Bug Overlay Camera Colliding w/ AR Background in URP 2020.2

Discussion in 'AR' started by fiddlegiant, Dec 27, 2020.

  1. fiddlegiant

    fiddlegiant

    Joined:
    Oct 22, 2015
    Posts:
    3
    Hello,

    I upgraded to 2020.2.0f1 and a scene that was working began disappearing on iOS only when an overlay camera is added to the primary camera stack.

    - I verified that everything continues to work fine on Mac OSX target and Android, but iOS can display either the overlay, or the AR background, but not both.

    I assembled a sample screen to reproduce in isolation and verified that it works fine on Android, but not on my iPad.

    To see the behavior:

    1) launch the attached sample on iOS device

    I have:
    - iPad mini (5th generation)
    - iOS 14.3

    2) move the device backward to see an AR cube over video
    3) Turn on the overlay (this sets the overlay camera game object to active)
    4) Notice that the cube disappears

    Or...

    5) (From Scratch) Install relevant packages (see below)
    6) Create a new scene
    - Add ArSession, ArSessionOrigin containing Camera
    - Switch to URP
    - Add URP Background Renderer and Wire accordingly
    - Put a cube in the scene
    - Run on iOS device and back up to see AR cube... all good.

    - Add anather Camera (as Overlay)
    - Put something in the view (I used orthographic camera with circle sprite partially transparent)
    - Add the overlay to the camera stack of the first camera
    - Run on iOS device and see no background video
    - Run on Android... all good.
    - I wired up some buttons to enable / disable the overlay and background at runtime and you can see the behavior on toggle.

    Compile the same for Android and notice the overlay working as exected

    I have:
    . Galaxy Tab S6 Lite
    . Android Version 10
    . Knox 3.5 API 31

    Current Package Manager for URP and AR:

    - 2020.20f1
    - URP 10.2.2
    - AR Foundation 4.0.9
    - ARCore XR Plugin 4.0.9
    - ARKit XR Plugin 4.1.1

    Some Details on Testing Locally

    Here's how I isolated the scenario if it's helpful ... After pulling the sample behavior into a standalone project, I went back to 2019 to see things working and then rolled forward as follows:

    Note: "Verified on iPad" means things worked... the overlay showed over the rendered scene on top of the video background. "Failed" means no video, or no scene, when overlay was enabled.

    Baseline - Working, Verified on iPad
    . 2019.4.11f1:
    - URP 7.3.1
    - AR Foundation 4.0.2
    - AR Subsystems 4.0.1
    - ARCore XR Plugin 4.0.3 (Untested)
    - ARKit XR Plugin 4.0.2

    Upgrade and Build
    . URP 7.5.1
    . Verified on iPad

    Upgrade and Build
    . AR Foundation 4.0.9
    . AR Subsystems 4.0.9
    . Verified on iPad

    Upgrade and Build
    . ARKit XR Plugin 4.0.9
    . Verified on iPad

    Upgrade Unity 2020.2.0f1
    . AR * 4.0.9
    . URP 10.2.2
    . Failed on iPad

    I'm attaching the sample project so folks can reproduce. I've not done this before, so I use the Unity Repo Project Wizard assuming it would be minimal... it seems to have included all the project settings and packages... hope that's not overkill. It's 1.8 Mb which seems small enough. I filed a bug to Unity presumptively, but if anyone sees something I'm missing, I'd love to get a fix so I can avoid rolling back to 2019...
     

    Attached Files:

  2. fiddlegiant

    fiddlegiant

    Joined:
    Oct 22, 2015
    Posts:
    3
    You may need to select ARKit in the Player Settings->XR Plug-in Management prior to building for iOS.

    I took a screen recording from the iPad so you can see the issue. The video shows a cube in space, then the overlay is toggled on and off (cube disappears?!) the background is toggled on and off and the cube reappears under the overlay... weird.
     

    Attached Files:

  3. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Hi @fiddlegiant, thanks for sharing. Do you mind posting these details via our bug reporter? That way the team can properly track and take a look. Cheers.
     
  4. fiddlegiant

    fiddlegiant

    Joined:
    Oct 22, 2015
    Posts:
    3
  5. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Thanks @fiddlegiant, our team will take a look. Please expect some time for us to catch up from the holidays.
     
  6. mb13admin

    mb13admin

    Joined:
    May 28, 2017
    Posts:
    22