Considering how complex UtilityLayerRenderer controls hierarchy

Considering how complex UtilityLayerRenderer controls hierarchy, it seems that utilitylayerRenderer is right behind it. Do you think it is possible to modify the hierarchical relationship between multiple UtilityLayerRenderers, or whether rendingGroupId can work normally from the same UtilityLayerRenderer?
In this case, the declared GizmoManager is always rendered above the declared CameraGizmo.
A Basic Scene | Babylon.js Playground (babylonjs.com)

If I want to render the CameraGizmo at the top, is there any way? It would also be ok to use the same UtilityLayerRenderer.

However, among the same utilitylayerRenderers, renderingGroupId does not work, and I cannot specify certain nodes to always be displayed at the top.

The UtilityLayerRenderer is a Scene just like any other, and renderingGroupId works the same. First the default scene is rendered, with its objects rendered in renderingGroupId order, then the utility layer scene is rendered, with its own objects rendered in renderingGroupId order: Testing utility layer | Babylon.js Playground (babylonjs.com)

1 Like

Thank you very much for your answer,I changed renderingGroupId to gizmo’s mesh, but the balls and cubes in the same coating will work. Is it because I used the wrong values for gizmo or because gizmo is special?
A Basic Scene | Babylon.js Playground (babylonjs.com)

What is the result you were expecting to see?

GizmoManager is always at the top of the layer.

In which camera? All of them?

Main camera

I understand what you’re asking now. The renderingGroupId order between the gizmo and the box in the utility layer is being respected, but since the box writes to the depth buffer, the gizmo is partially occluded by it. You can disable depth writing on the box so the gizmo is always drawn: A Basic Scene | Babylon.js Playground (babylonjs.com)

That’s a workable solution, thank you!

1 Like