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

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: ARFoundation: screen tearing on iOS, but not On Android - Questions & Answers - Unity Discussions

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

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.

1 Like

Glad you were able to mitigate the issue! To help debug your screen tearing issue, you might look into XCode’s Metal Debugger to learn more about what’s going on in your application render. Analyzing your Metal workload | Apple Developer Documentation

@andyb-unity Thanks! I could not find the Metal Debugger in XCode … is it possible I don’t have the Metal API enabled?

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

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.

Here is my screen from Xcode - could not locate it

Screenshot taken using XCode 13.4. You can also find the Capture GPU workload option in the Debug dropdown menu

Thanks!

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.

1 Like

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.

1 Like

Thank you!!

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?

Disabling multi-threaded rendering solved the problem for me. Unity 2021.3.9f1, AR Foundation 4.2.3, Built-In Render Pipeline.

2 Likes

This fixed it instantly for me whereas it was previously unuseable. Unity 2020.3.33 AR Kit 4.1.10

See the discussion on Github for iOS 16 multi-threaded rendering issues. This issue is still active: When running on iOS 16 the camera feed is unstable (shaky and jittery) when multi-threaded rendering is enabled · Issue #988 · Unity-Technologies/arfoundation-samples · GitHub

1 Like

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.).