Babylon doesn't import lights

Hello,

I’ve been importing the 3D model of a building I’ve modified in the Babylon Sandbox.I’ve tried both ‘Scene Export’ and GLTF ‘Exports’ to export a .babylon and a .glb file. Under ‘GLTF Exports’ I’ve made sure to toggle ‘Export Lights’ to export a directional and possibly a ShadowGenerator added to it.

In my project, I use LoadAssetContainerAsync() following the documentation and its example scene to import my model along with all its necessary assets, but my scene appears completely black. I need to manually create a DirectionalLight to see the meshes and their textures.

My question is why the loader doesn’t seem to recognize the light, while it has no issue with materials, textures, etc. Any suggestions would help.

Check if your light is punctual (point, spot or directional) - glTF 2.0 - Blender 4.2 Manual
Check the light intensity and adjust if needed. Probably it is too low.
Use the Inspector to debug.
Here is the example of imported GLTF light - https://playground.babylonjs.com/#T9KCFH#1

1 Like

Hi, thank you for your help. I installed the inspector afterwards, and it seems one of my scripts automatically removed some of the file’s assets before adding it to the scene. Must have been an early draft from my old importer. Think I did that so I could recreate the light myself and have more control over the shadowGenerator. So, this one’s on me :slight_smile:

1 Like