RealityKit Plane flickering bug in Model with VideoMaterial

I am working on an AR app on iOS. I found this issue and can't find a quick solution at this moment nor do I find any insight into what is happening.

Context:

The AR app contains a 3D model of a sphere that is cut in half. The models are created with a 3D modeling software.

Additional context:

The sphere model is placed inside the environment. When the user enters the sphere then the sphere materials are set to video materials containing this jungle-like content visible in the video.

The vertical center of the sphere is the floor on which the user moves and looks around. Each ARPlaneAnchor is connected to an ARAnchorEntity with its ModelEntity (Plane) for visualization and sphere placement.

The bug (video):

https://www.youtube.com/shorts/58860U1IkhM

As the user moves inside the sphere parts of the video material start to show the square plane camera feed parts (background).

What has been tried:

  • changing material type on the floor plane (physically based material seems a little less bad)
  • changing the culling of the materials (no effect). the issue is not related to z-fighting. When a solid material for the floor plane is used then the flickering is not visible. When a solid material with alpha is used then both are visible (alpha material and flickering background)
  • editing the .usdz file (does not work at all) (changing shadows and other properties)
  • checked .usdz file with usdz tools (usdzconvert - all tests have passed and fixed opacity did not help)
  • Changing the video type (.mp4 to .mov)
  • Google & ChatGPT

Similar issues:

Observations:

  • The flickering background is always tied to the floor plane (can provide screenshots). This seems to highlight either a point of contact with the 3D floor plane or something else.
  • The flickering happens at some certain angle and position. It does not happen all the time in all positions which is weird.
  • This problem didn't happen with the old sphere 3D file. The difference is a new 3D-generated floor plane WHICH IS DISABLED. It seems that even if it is disabled it is still being used somehow.
  • I had a similar issue where the floor planes would change color (the color tone would go more light and dark). This issue was solved by disabling automatic shadow rendering. Shadow rendering inside an object does not seem to work properly. The main difference is that the previous issue changed the color brightness, not color transparency (translucent), and that the whole plane color was changed and not some part of it.
  • Logging all the available planes shows only the expected planes (1-3, of which 1-2 two are floor planes and 1 is an image plane).

Any ideas, solutions, or feedback is welcome.

SO Post:

https://stackoverflow.com/questions/78139934/realitykit-plane-flickering-bug-in-model-with-videomaterial

Thank you for your time.