I’m building an app where a key feature is that you can place and slide things around on walls. I’m using a sprite renderer, and I’m having an issue where the elements i’m trying to place on the wall seem to be z-fighting with the walls, sometimes getting occluded randomly. I tried raising the order in layer on the polyspatialUI layer, but I’m still seeing the occlusion. Is there any way to 100% remove any occlusion from a group of objects? I’m fine if they’re visible through walls, I just don’t want them ever to be hidden like they currently are.
I am using plane tracking, but only vertical planes, and the prefab I’m using for them has colliders, but no meshrenderer, so there shouldn’t be anything occluding the frames i’m placing on the wall. I think this is happening automatically via the live meshing or something. Any workaround?
Hey there! Thanks for reaching out and sorry to hear you’re having trouble.
That’s kind of surprising. If your app mode is set to VR, you have complete control of the rendering of your content, with the exception of your hands/arms and other people poking through every now and again. If there aren’t any Unity objects there, there’s nothing for the sprite to Z-fight with!
Did you base your scene on the package sample? That scene has a MeshVisualizer object under the ARKit transform in the XR Origin hierarchy to create mesh renderers for the world mesh coming from ARKit. Is it possible that’s sneaking around somewhere? If you create a scene with just and XR Origin and this sprite, do you still see Z-fighting?
Something you might try is to enable the XR Simulation loader (a.k.a. XR Plugin) from AR Foundation in Project Settings > XR Management. The leftmost tab for standalone build target will be where you can find it, and that tab contains what loaders are available in the Editor. With that loader enabled, when you enter Play mode you should see a basic simulation environment (a pair of planes and an image marker) that will simulate the planes and meshes that get scanned by an XR device. Do you see the Z-fighting in Play mode with XR Simulation? Do you see any unexpected objects in the hierarchy that may be rendering those meshes?
If you still can’t figure it out, please submit a bug report (Help > Report a bug...) with a project that reproduces the issue. If you have trouble uploading your project, feel free to upload it to Google Drive or a secure file sharing service, and include a download link in the bug report. If we can replicate the issue on our end, it will be easier to track down the cause.
yeah, I don’t have the dynamic meshing enabled. I do have vertical plane tracking, but the vertical plane prefab I provide has no mesh, only colliders.