Trasparency Not Rendered Properly for Some View Directions

The transparency in reality kit is not rendered properly from specific ordinal axes. It seems like it is a depth sorting issue where it is rejecting some transparent surfaces when it should not. Some view directions relative to specific ordinal axes are fine. I have not narrowed down which specific axes is the problem. This is true across particle systems and/or meshes. It is very easy to replicate this issues using multiple transparent meshes or particle systems.

In the above gif you can see the problem in multiple instances, the fire and snow particles are sorted behind the terrain, which has transparency since it is a procedural blend of grass, rock, and ice, but it is correctly sorted in front of the opaque materials such the rocks and wood.

In the above gif, it is two back to back grid meshes (since dual sided rendering is not supported) that have a custom surface shader to animate the mesh in a wave and also apply transperency. You can see in the distance, where the transparency seems to be rendered/overlapped correctely, but at the overlap approaches the screen (and crosses an ordinal axes) it renders black for the transparent portion of the surface, when the green of the mesh that is behind should be rendered.

This is a blocking problem for the development of this demo.

Replies

I've been really burning a lot of time on this as well. I've tried sort groups, but they're not viable because the ordering isn't always going to be the same if the user is moving around in the space. To add some detail to the issue, I've noticed this is most pronounced when multiple objects with transparency are layered on one another. In other words, if you have a single tree imposter (a flat plane with a tree textured onto it and an opacity map) it will overlay onto a background properly. However, if there's a second tree imposter, and the two objects overlap visually, RealityKit will eventually skip drawing one of them rather than drawing all transparent objects.