Transparent Material Turning into Occlusion Material

I am trying to create an object in immersive space that is partially transparent (~50% opacity). I have implemented this in a few different ways including creating a model entity and setting its opacity component to 0.5, and creating a custom material with blending set to a transparent opacity of 0.5. These both work partially, as they behaved as intended for many cases, but seemingly randomly would act like occlusion material and block any other immersive content behind them, showing the real world instead.

Some notes: I am using RealityKit to render the semi-transparent object and an opaque object that is behind the semi-transparent object. I am using VisionOS 2.1, and am updating the location of the semi-transparent object often. Both objects are ModelEntities.

I would appreciate any guidance on how to implement this. Please let me know if there are any other questions.

Answered by DTS Engineer in 836475022

Maybe this sample might be useful for this investigation:

Implementing adjustable material

It features some translucent material.

Maybe this sample might be useful for this investigation:

Implementing adjustable material

It features some translucent material.

Hey @S1IndustriesPBC-jake,

Can you provide a focused sample that reproduces the issue? On the surface, this sounds like a classic rendering order issue (Your transparent object is being rendered first, writing to the depth buffer, and preventing the object behind it from being rendered).

However, typically fully opaque objects are rendered before transparent objects to mitigate this problem, so I'd like to see a focused sample to see what's going on!

--Greg

I just wanted to give an update on this issue. We have found a fix using the ModelSortGroupComponent on both entities, and assigning a higher order to the transparent entity.

Transparent Material Turning into Occlusion Material
 
 
Q