Incremental Loading System

How To Use the Incremental Loading System

In order to support incremental loading (introduced by v1.5.0), you just have to go to this page in order to get a tool to convert your .babylon file to a .incremental.babylon file alongside associated resources (.babylonmeshdata and .babylongeometrydata files).

These files can be used just like a standard .babylon scene except that they will allow Babylon.js to load meshes and textures on the fly. This means that the meshes and the textures will not be loaded at startup but only when they become active (when the active camera can see them).

You have to put the .babylonmeshdata and .babylongeometrydata files in the same folder as the .incremental.babylon file.

You can find a demo of an incremental scene here: Incremental Loading Example

Detailed Step by step

For users less experienced with command line tools, here's a more detailed step by step of what you need to use the tool:

  1. Get the Exporters project (by either using git or downloading the ZIP): Exporters project

  2. Download and install .NET Core 3.1

  3. Open a command prompt (cmd.exe should do the trick) and navigate to the MakeIncremental directory: MakeIncremental directory

  4. Type dotnet build on the command prompt: .NET build

  5. Navigate to the directory where the build files were written, \bin\Debug\netcoreapp3.1\: Build directory

  6. Type the command MakeIncremental.exe /i:my-scene.babylon, where my-scene.babylon is the name of your scene (if your scene is named something else, just change what's after the : symbol): Run command

  7. The script is going to generate quite a few files, you will need all of them, except your original my-scene.babylon. Copy them to a directory your project has access to (on this example, it's /src): Generated files

  8. And you're ready to load it into Babylon!

BABYLON.SceneLoader.Append("src/", "my-scene.incremental.babylon", scene, function() {
console.log("My incremental file was loaded! WOHOO!");

Node.js based incremental file converter

This script can be used to generate incremental files from babylon scenes. It can be ran directly from node or it can be integrated into build scripts. More information about how to install and configure the script can be found here.