I know material has a limit on the impact on light … I also know to increase the limit on the material, namely by using the material.MaxSimultaneousLights
but it can be used if creating new materials … meaning that it cannot be increased directly by means of mesh.material.maxSimultaneousLight. I want to upgrade the material without creating a new material.
Actually it looks like a bug, when switching to BJS v4.2 in my example I can set mtl.maxSimultaneousLights = 300 without any issue. It’s been a long time I pinged @Deltakosh
There is a limit on the number of uniform buffers used in a shader. It seems 12 is a common value, at least it’s the one of my GPU for the vertex shader.
Each light consumes a buffer. Babylon is also using a buffer for the scene, mesh and material objects. So, with 9 lights, you reach the limit of 12. Adding a new light will get you an error saying that you exceed the maximum number of uniform buffers you can use in a vertex shader. In 4.2 we did not create a uniform buffer for the mesh data, so you had room for an additional light compared to 5.0.
I can set mtl.maxSimultaneousLights = 300
maxSimultaneousLights is just the maximum number of simultaneous lights allowed, it does not create uniform buffers. Try to create 11 lights: it won’t work even in 4.2 (because 11 lights + scene + material buffers = 13):
You would need to do that in your DCC tool like Blender. Look for “lightmap” in this forum, a number of posts should show up. I myself does not know how to create them in external tools.
Since Blender 2.8+ you can edit multiple meshes as the same time, so just select them, be sure that your correct UV channel is active on all meshes (my ReTiCo addon could help to quickly activate UV1 or 2 on selection), unwrap, and you’re good.