Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Jitter and screen tearing on iOS only using AR Foundation 4.2.3 / Unity 2021.3

Discussion in 'AR' started by agbrandon, May 30, 2022.

  1. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    16
    I'm getting a strange screen tearing artifact on iOS when I upgraded a project to AR Foundation 4.2.3 and Unity 2021.3.

    Video here:


    It seems related to this old unanswered thread here: https://answers.unity.com/questions/1602069/arfoundation-screen-tearing-on-ios-but-not-on-andr.html

    Any suggestions?

    I've seen VSync referenced in other threads but I thought Vsync was disabled on mobile.

    This occured on two different iOS devices, one being an iPad 6th gen, and the other an iPhone 8 plus.

    Everything works fine on Android, and it worked fine on 2020.31f1 and AR Foundation 4.0.12
     
    Last edited: May 30, 2022
  2. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    16
    So I fixed the issue, but still not totally sure what caused it.

    At first I thought it was a simple FPS thing as some of my scenes were more complex than others. But getting the frame rate down didn't help.

    What ended up fixing it was one of these things

    1. Turning off anti-aliasing
    2. Disabling postprocessing (I wasn't using it anyway)
    3. Removing some old render pipelines and renderer features from an unused Asset (Lyceum AR Portals).

    I am still getting a little bit of screen tearing, but the objects are stable now.
     
    Last edited: May 31, 2022
    andyb-unity likes this.
  3. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,018
  4. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    16
    @andyb-unity Thanks! I could not find the Metal Debugger in XCode .. is it possible I don't have the Metal API enabled?




    upload_2022-6-1_11-13-18.png

    I went to my project settings and the Metal Editor Support was not there.

    upload_2022-6-1_11-14-8.png

    I was using Linear color space before, but switched to see if it would help the issue (it did not).

    What am I missing? I use GLES3 for Android.

    EDIT: I see now that only Metal is enabled for iOS.
     
    Last edited: Jun 1, 2022
  5. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    16
    Here is my screen from Xcode - could not locate it

    upload_2022-6-1_11-32-24.png
     
  6. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,018
    Screenshot taken using XCode 13.4. You can also find the Capture GPU workload option in the Debug dropdown menu

    Screen Shot 2022-06-02 at 3.32.07 PM.png
     
  7. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    16
    Thanks!
     
  8. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    16
    EDIT: Disabling HDR and Depth in URP settings also helped considerably, but I was still getting a little bit of screen tearing even then. It seems the problem is restricted to devices older than iPhone 8 plus.
     
    andyb-unity likes this.
  9. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
    There is a possibility that the texture that we use to render the background is actively being written to the camera. This would only occur in situations where rendering has spilled over into the next frame.

    You could check to see if this is the case by using the Metal GPU Profiling tool to look for the AR Background Pass (URP) and check the actual camera textures you received. If the textures themselves are tearing then it's probable this is the problem.
     
    Last edited: Jun 14, 2022
    agbrandon likes this.
  10. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    16
    Thank you!!
     
  11. thesanketkale

    thesanketkale

    Joined:
    Dec 14, 2016
    Posts:
    63
    Hi @agbrandon, I am also seeing jittery camera feed on my iPad 6th generation in iOS app built with Unity 2021.1.28f1 and AR Foundation 4.1.10 using Built-In Render Pipeline.

    I tried everything mentioned here, even tried disabling multi-threaded rendering, but nothing seems to solve it for me. Could you please share how you were able to fix it?
     
  12. dhindman

    dhindman

    Joined:
    Jan 28, 2016
    Posts:
    17
    Disabling multi-threaded rendering solved the problem for me. Unity 2021.3.9f1, AR Foundation 4.2.3, Built-In Render Pipeline.
     
    angles20 and seanbiganski like this.
  13. seanbiganski

    seanbiganski

    Joined:
    Aug 17, 2016
    Posts:
    31
    This fixed it instantly for me whereas it was previously unuseable. Unity 2020.3.33 AR Kit 4.1.10
     
  14. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,018
    seanbiganski likes this.
  15. agbrandon

    agbrandon

    Joined:
    Nov 20, 2019
    Posts:
    16
    Hi @thesanketkale - sorry I didn't see this earlier. I was never able to fix it completely. Turning off multithreaded rendering also did not work for me. The only thing that helped was optimizing the scene as much as possible (baked lighting etc.).