I decided to make a new thread related to my question in another thread. Best way to create part of a mesh that acts as a light source - #10 by Panuchka
It seems to me that dynamic lights with
includedOnlyMeshes populated after render loop has been initialized do not have an effect on instanced meshes at all! There was some code comments that pointed to the fact that “do nothing as all the work will be done by source mesh”. Could someone clarify this behavior and if this is working as intended.
My use case is to have many instanced meshes (wall and floor tiles) that have meta information about whether or not they have lights included in them. I planned to use
includedOnlyMeshes to manually turn on/off lights that are not in players radius, or otherwise would break the light limit count of the material.
Here is an example of the problem. In the
setTimeout function the (instanced) ball does not light up at all when the spotlight is created and
includedOnlyMeshes is updated: https://playground.babylonjs.com/#1FUKMR#8
Here is an example without instancing: https://playground.babylonjs.com/#1FUKMR#9