BabylonJS/Babylon.js — pull request #205 by marcolebdech (2014-05-30 06:14:58+00:00)
Title: Added "layerMask" property to meshes and cameras.

Implementation of Layers from Unity or 3DSMax. Each camera has 32bit mask of layers which it renders ( 1 bit for each layer ) and each mesh has bit-mask of layers, in which it should be rendered.

There is possible fail if numbers in Javascript interpreter are represented as floats instead of doubles. Float is not precise enough to hold all uint_32 values without value deformation.

Default values for both are 0xFFFFFFFF (maximum of 32-bit unsigned int), so in default configuration all meshes are rendered in all cameras.

Property is also implemented in .babylon-file parser, so there can be defined meshes connected to various cameras added by script.

Property is not implemented in serializer and lensFlareSystem yet.

Maybe needs some check in conditions, where meshes are filtered to be (not) visible.