Lighting gltf models

PG: https://www.babylonjs-playground.com/#Q2PFCM#1

I noticed that if you assign a parent to the gltf model, then the lighting of part of the model is lost. Launch the latest version of Babylon and previous ones (4.1.0). Everything works correctly only in the latest version. What’s the matter?

I am not seeing the issue you are refering to in the playground you linked. My guess is that you are breaking the parenting to a negatively scaled node (__root) which is meant to go from right to left handed and so breaking the entire lighting.

My gltf model is also not affected by ambient light; I can’t find the reason.

1 Like

What do you call ambient light in this case ? The ambient color on the scene or an hemispheric light or the env texture ?

The current situation is that the lamp cannot illuminate the table; the table is gltf and the floor is BABYLON.MeshBuilder.CreatePolygon.


Now the lamp has passed through the wall。

We can not see the pictures for some reasons :frowning: but in general lights will bleed through walls and to workaround that you could rely on the lights includeOnlyMeshes or excludedMeshes properties.

Regarding the light not affecting your gltf objects, it is because the light fall off can be computed differently depending on the material types. I would recommend to only use PBR materials if you have gltf in your scenes and to set all of them to the same gltf falloff types: Light Illumination Modes

1 Like