The default layer mask of meshes, cameras etc is 0x0FFFFFFF. This means, there are 4 bits left for separate views.

Maybe introduce a defaultLayerMask which one may set to a more suitable mask for the scene.

scene.defaultLayerMask = 0xff;

Just read this value for the layerMask of new meshes and cameras, since meshes and cameras get the scene per constructor.

It makes sense that you would want to change the default layer mask, but I think I would expect this to be a property of the engine.

Could you explain your reasoning for wanting to have it as a property of the scene? My fear is that it will not be the obvious place to look for other developers.

I think the layer mask is a matter of the scene. This value only makes sense with scenes.

In a multi-scene application, the main menu scene has different requirements than the game scene. I would be happy if I could set this value after creating each scene (even though most of the time I would probably set it to 0x1).

Makes sense, do you want to create a PR for it ?

Instead of having one defaultLayerMask do you think there are advantages to have at least a defaultSceneObjectLayerMask (the left operand of &) and a defaultCameraLayerMask (the right operand of &)? However, I have no idea how to name these variables actually.

1 Like

I can not help with names :slight_smile: I guarantee you do not want me to help with this part :slight_smile:

About the 2 defaults it sounds good to me