RealityView attachment draw order

My visionOS 26.3 app displays a diorama-like scene in a RealityView in a mixed immersive space, about 1 meter square, with view attachments floating above the scene.

Each view attachment fades out after user interaction, by animating the view's opacity.

What I'm observing is that depending on the position of a view attachment relative to the scene and the camera, an unwanted cutout effect is observed (presumably because of draw order issues), as shown in the right column in the screenshots below.

YouTube video link of these sequences: https://youtu.be/oTuo0okKCkc (19 seconds)

My question:

How does visionOS determine the view attachment draw order relative to the RealityView scene?

If I better understood how the draw order is determined, I could modify my scene to ensure that the view attachments were always drawn after the scene, fixing the unwanted cutout effect.

I've successfully used ModelSortGroupComponent to control the draw order of entities within the RealityView scene, but my understanding is that this approach cannot be used with view attachments.

I've submitted FB22014370 about this issue.

Thank you.

Hey  @drewolbrich,

Thanks for filing this feedback. I wasn't able to replicate your experience, but I'm curious if you get the same result by replacing opacity(_:) with OpacityComponent?

Additionally, have you considered applying a subtle breakthrough effect on your views? This might mitigate the issue and could improve things if you expect your views to collide your content.

Are you able to replicate this behavior in a sample project that we could take a look at? Feel free to link it publicly here, or you can privately share any project with us in your Feedback Request. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Thanks,
Michael

RealityView attachment draw order
 
 
Q