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:
-
Get the Exporters project (by either using git or downloading the ZIP):
-
Download and install .NET Core 3.1
-
Open a command prompt (cmd.exe should do the trick) and navigate to the MakeIncremental directory:
-
Type
dotnet build
on the command prompt: -
Navigate to the directory where the build files were written,
\bin\Debug\netcoreapp3.1\
: -
Type the command
MakeIncremental.exe /i:my-scene.babylon
, wheremy-scene.babylon
is the name of your scene (if your scene is named something else, just change what's after the:
symbol): -
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
): -
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.