GizmoManager incompatible with GUI3DManager

When a scene has both the GizmoManager and the GUI3DManager instatiated with default settings, the gizmos are no longer rendered on top and instead are occluded by scene geometry. This occurs because GUI3DManager alters the autoClearDepthAndStencil of the default utility layer.

Reprex: https://playground.babylonjs.com/#4TBMBR#68

Source: Babylon.js/gui3DManager.ts at 9a683e8bf114a1d66648801631e9c8dbc4529415 · BabylonJS/Babylon.js · GitHub

Workaround: You can create a new utility layer to pass into GizmoManager and it will work again.

For my case, I’d rather use a new utility layer for the GUI3DManager instead, but it seems there’s no constructor option or public properties that allow you to change the utility layer for GUI3DManager away from the default

2 Likes

We should add one for sure
cc @DarraghBurke if he wants to have a look

2 Likes

Hey @FrameVRWill, allowing you to change the utility layer for GUI3DManager seems like a great idea! Would you be open to making a PR for it? Seems like the changes should be contained to just that class.

If you have any issues with it let me know and I can definitely take a look :slight_smile: