Transparency Bug in Image Component on VisionOS Application

Hello, Polyspatial development team. I am currently developing a fully immersive VisionOS application, but I have encountered an issue with the Image component. When viewed from certain angles or distances on the Vision Pro device, a bug effect occurs where it appears to be transparent. This issue can also be replicated in the Xcode simulator. Is this a known problem, and is there already a solution available? The first image below shows the normal state, while the second image shows the effect after the bug occurs.


1 Like

Although there are few developers for Polyspatial, I still hope someone sees and addresses this issue.

I cant’ quite tell from the picture, but it sure looks like you may have a sort ordering/z fighting issue. The fact that the issue appears (from your pictures) to be head position dependent makes me think even more that it’s potentially z fighting.

Have you tried putting these into a sorting group to enforce the correct ordering?

1 Like

Hello Joejo, I’m glad to receive your response. In fact, I created an automatic sorting component based on the Vision OS sorting group that sorts all child objects from front to back, with values sorted from high to low. The sorting values are assigned as follows: text 3, image 2, mesh 1, and background 0. I’m using a Post Pass mode for processing, but the issue persists; at certain positions, the images still exhibit transparency bugs. Do you think there is a problem with my sorting method?

Did you derive from the VisionOSSortingGroup component?

If so, if you switch it out to only use the VisionOSSortingGroup instead doe you still see the issue?

Yes, I derived a component from VisionOSSortingGroup to facilitate the automatic addition of sorting groups, so the underlying principles are the same. Initially, when I used VisionOSSortingGroup, I encountered similar issues, particularly with transparent image components. This issue does not occur with opaque images. I’m not sure if this problem is caused by VisionOSSortingGroup itself.

Currently, PolySpatial doesn’t track subclasses of things like VisionOSSortingGroup. It’s something that we’ve discussed internally (tracking subclasses) but not something we support now. That means there is a better than even chance that your subclass is not actually causing sorting groups to be applied in visionOS.

I’m also wondering if you are running fully immersive? Or you are running in unbounded mode?

In either case, if you can provide a small repro sample, we can take a look and see if there is an issue or how to resolve this.

Thank you for providing the important information regarding the VisionOSSortingGroup not tracking subclasses. I appreciate it. Currently, i am running the project in fully immersive mode. I will do my best to provide a small reproduction sample for your review. Thank you again for your assistance!

Hi jeojo,

I’ve recently found some time to create a minimal reproducible example. My development environment is Unity 2022.3.26f1 and PolySpatial 1.3.9. This sample perfectly demonstrates the issue I mentioned before. Here is the link:
Z-Fighting.zip (2.7 MB)

I hope you can take a look at it soon and run it on the simulator or on a real device.

Thank you!

Thank you. I’ll take a look and see.

Are there any particular repro steps or things I need to know for this?

Yes, you need to play the device on the Xcode simulator. In the scene, there will be a 3D transparent panel and a transparent dropdown. When looking at it from different positions and angles, you will encounter a bug similar to Z fighting, where the visuals become distorted and the perspective issues become very apparent.

One thing that I see off the bat has to do with how you setup the sorting group. You set the DropDown to 0, but I think that won’t apply to the actual drop down visuals as those are created at runtime. You may want to try to check the ā€œApply to Descendantsā€ setting for the Drop down.

Without that set, I get z-fighting immediately between the actual drop down scroll view and the backing panel. With that enabled I get no z-fighting. I also believe that with that enabled you don’t need to explicitly add the label or the arrow to the sorting group either.

Hi Joejo, thank you so much for your response! I followed your advice and set the sorting of the dropdown to 0 while enabling ā€œApply to Descendants,ā€ which improved the situation significantly. However, I encountered another issue with perspective distortion when I raised the camera view. I’d like to know if this bug is also related to Z-fighting.


Not sure what perspective distortion you are talking about? I mean, your camera view is way at the base of the panel looking up (like an ant would) so things look about correct to me from that perspective?

Note that we don’t control the camera rendering in any way, so what you see is how RealityKit renders things within the scene.

When looking up from the bottom (as you mentioned, like an ant looking up, similar to the first image I shared), I can see the content behind the UI panel as if there were a perspective effect. However, I’m confident that my sorting settings are correct. Is this behavior expected when rendering in RealityKit?

I’m not sure what you are referring to. Can you post an image, edited to point out the effect you are talking about?

I can say that we are doing no rendering in the view in the simulator. Any perspective issues you may be seeing would be due to RealityKit.

I looked at your project as well, and one thing that I noticed was that the red box in the background (rendered as a MeshRenderer on the ā€œPanelā€ GameObject) wasn’t in your sorting group, which means that it isn’t guaranteed to be rendered before the other (UI) elements in the sorting group. You might want to try adding the Panel GameObject to the sorting group and setting its order lower than the others (e.g., -1). The other thing that I noticed is that you have multiple separate sorting groups (versus just the one on Panel). Sorting order is only guaranteed within a single group. There’s no guarantee of the render order between different groups.

1 Like

Heh, sorry @AstoraGray , for some reason I was looking right through the hole you were talking about trying to find the perspective geometry distortion I thought you were talking about. My bad, entirely.