Use BABYLON.SceneLoader.Append to load .babylon file and get black screen

I create some simple meshes and lights in blender and then export a .babylon file.

But when I want to import this babylon file in my html file, something go wrong.

If I use BABYLON.SceneLoader.ImportMesh, it looks ok. If I use BABYLON.SceneLoader.Append, I can just see full screen black and in console has no error message.

This is pg link Babylon.js Playground

All right… I find the problem. There is a config “fogMode: 1” in the .babylon file. When I delete this line everything great.

That is settable in Blender, but rarely done. I will look up what to change in .blend so it gets generated that way sometime today.

3 Likes

Fog is a combination of custom properties on world with some builtin properties. Here are the default settings for the custom properties:

You must have changed fog mode from None(0), to Exponential(1). You also set the density to 1.

Fixing would be to just set mode back to None.


The properties coming from Blender:

  • fogColor: comes from world surface color
  • fogStart: comes from world mist pass start
  • fogEnd: comes from world mist pass depth

You also need to turn on mist mass from View Layer Tab in order to see them in World.

world with mist

2 Likes

Thank you very much! That’s where I set it up wrong, and all the problems were solved after the change!!