My VisionOS Port flickering like a Christmas tree

So our port is suffering from massive layers disappearing and alpha issues(which seems to be relative to the y rotation of the head.). I have implemented shader graphs and URP specific shaders as well as VisionOSortingGroups. While some things change when we do make these changes it is often just broken differently.

The Images show it a little but the video clip shows it much better.

Any help would be appreciated



Video of what my problem looks like

Still looking for help with this. With the link being buried below the images, here it is again. Video Clip

Hello! To me, this looks like a sorting/z-fighting issue, and I would expect that using VisionOS Sorting Group is the best way to resolve it, though the particular setup necessary to do so may not be obvious.

Would it be possible to create a repro case and submit it as a bug report, and let us know the incident number (IN-#####)? That would help us better understand what might be going wrong.

Thanks for the response. I am using the VisionOSSortingGroup. Though I am curious, since you can only have one VisionOSSortingGroup on a GameObject, is this a misprint and they mean prefab instead of GameObject? In other words, if I have an instantiated prefab should here only be a single SortingGroup on the root object or should there be one on each GameObject?

Anyways, I will post a bug report on this.

Thanks again,

The GameObject that you put the VisionOS Sorting Group on doesn’t really matter, as the sorting group must list all the Renderers that it applies to (which can be MeshRenderers, CanvasRenderers, or SpriteRenderers). If you include the VisionOS Sorting Group in a prefab, then each instance of that prefab will have a separate sorting group.

Bug report posted - IN-71652 - I am not allowed to share our code for a number of reasons so I am not sure if anyone can actually troubleshoot anything without it. But it’s not my call.

Also on the sorting groups, not sure if it’s a failing on my Rider decompiler or not, but can’t seem to find anything documentation or info about the deeper workings of VisionOSSortingGroups or of the ObjectBridge.MarkDirty statement. So if I have a bunch of prefabs with Sorting Groups set - because each of these individual objects have direct references to the individual renderers - when I parent all of these objects to one another as one big family… there is no problem?

The documentation for the VisionOS Sorting Group is here. You should not need to use ObjectBridge.MarkDirty; it’s an internal utility method that we use to signal that components should be transferred over PolySpatial. If you’re adding elements to the sorting group at runtime, though, it’s probably useful to know that you have to reassign the renderers property in order for the change to be detected.

I guess that depends on what you consider a problem. If you have multiple sorting groups, you can’t control the sorting of the groups with respect to each other. You can only control the sorting of the elements within each group (relative to the other elements in that group).

Would this also be true if you are doing kind of the inverse? For example, instead of adding a new renderer to the groups, If we are essentially using a game object as “folder” and instantiating new prefabs into that object that is already marked for ApplyToDescendants, will those new children automatically be sorted along with parent?

Also, when you sate “reassign” the renders, to you essentially mean copy the list, null the renderers list on the component, then reapply the copy to the list? Is that sufficient to trigger the detection/update?

In 1.1.6, they will not. We have a fix for this that will go into the next release, but one workaround for the time being would be to dirty the VisionOSSortingGroup by setting its depthPass or renderers property. Doing so will mark the sorting group as dirty for that frame, and will cause PolySpatial to resend the sorting group information and (re)apply it on the RealityKit side.

Even setting the renderers or depthPass properties to their current values will be enough to trigger the update. The issue is that you can’t just add an element to the renderers list, because that won’t be detected in the current API. So, instead of just:

sortingGroup.renderers.Add(anotherRenderer);

You would need to use:

sortingGroup.renderers.Add(anotherRenderer);
sortingGroup.renderers = sortingGroup.renderers;

Since it’s the property setter that marks the sorting group as dirty.

2 Likes

Thank you for details and update, it is very helpful.

1 Like