Draw order between model sort groups

I’m familiar with using ModelSortGroupComponent to control draw order, but how does RealityKit determine the draw order between model sort groups?

How can I enforce a specific draw order between two model sort groups that require different depth pass modes and therefore can't be combined into a single model sort group?

Are there model bounding box tricks I can safely rely on?

Answered by Frameworks Engineer in 891442022

Hi @drewolbrich,

Two model sort groups are ordered by the distance to the camera/view of their centers. The center of each group is defined as the center of the combined bounding box of all entities in the group.

You can try positioning the group that needs to be drawn first generally further away than the group that needs to be drawn second to see if that works.

If you have suggestion on other ways to order them, feel free to file a Feedback using https://developer.apple.com/feedback-assistant/ on this issue and post the bug number here.

Thanks.

Accepted Answer

Hi @drewolbrich,

Two model sort groups are ordered by the distance to the camera/view of their centers. The center of each group is defined as the center of the combined bounding box of all entities in the group.

You can try positioning the group that needs to be drawn first generally further away than the group that needs to be drawn second to see if that works.

If you have suggestion on other ways to order them, feel free to file a Feedback using https://developer.apple.com/feedback-assistant/ on this issue and post the bug number here.

Thanks.

Draw order between model sort groups
 
 
Q