Did max lights change?

Hello Fellow Babylon Devleopers,

I do wonder if it’s now possible to use more lights i need at least 5 for my sence.
Which are 4 spot lights and one hermispheric light.

I did see demos which had more than 4 lights (up to 32) so i though that would be possible.
So i tried to load my mesh and change that property on the mesh so i could use more lights but it seems like that it doesn’t work. Here to note i use a gltf as mesh that has textures and normal maps.

This is the code i use:

if(mesh.material != null){
                    mesh.material.maxSimultaneousLights = 16;
                    mesh.maxSimultaneousLights = 16;
                } else {
                    mesh.material = material;
                    mesh.maxSimultaneousLights = 16;
                }

The light count is just a random value…

Or is it just not possible to be used when i use a gltf mesh and works when it’s a generated mesh? (I do hope not)

You’re sure you have the actual mesh and not the gltf/glb root node?

@aWeirdo
I do load it like that:

BABYLON.SceneLoader.AppendAsync("", "assets/_solid.glb", scene, null, ".glb").then(function(compound1) { 
            for (mesh of compound1.meshes) {

I suspected it going over everything then or is there something else i need todo?

can you make a repro in the playground?

It seems like it’s something with the gltf… i can’t give this out though.
I tried it with the same setup as i do have for my gltf. And it worked.

1 Like