The gizmo layer (a variable passed when constructing a gizmo) Is a reference to the utility layer that will render the gizmo. A utility layer is constructor for a specific scene. The default one is created for the last available scene:
/**
* A shared utility layer that can be used to overlay objects into a scene (Depth map of the previous scene is cleared before drawing on top of it)
*/
public static get DefaultUtilityLayer(): UtilityLayerRenderer {
if (UtilityLayerRenderer._DefaultUtilityLayer == null) {
return UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(EngineStore.LastCreatedScene!);
}
return UtilityLayerRenderer._DefaultUtilityLayer;
}
You can create your own utility layer, attached to the right scene, and pass it to the gizmo. You can read about it here - Rendering Utility Layers | Babylon.js Documentation