How to implement incremental loading for GLTF Model?

I need to import heavy models in my scene. I checked the documentation but implementation for .babylon extension was present (for incremental loading) . Can somebody let me know if we can implement same concept for GLTF Models ??

You could try to separate your models into different GLTF files and load them using the var assetContainer = await SceneLoader.LoadAssetContainerAsync(...). Once the asset is loaded you can just assetContainer.instantiateModelsToScene().

This would instantiate the models as they load into the scene.

I’m not sure if there’s a better approach to that.

1 Like

I want to know , how to implement incremental loading for GLTF Models like in this scene it is done for .babylon files.
Use Incremental Loading - Babylon.js Documentation).

You will need to convert you GLTF into a .babylon scene and then convert this “.babylon” to a “.incremental.babylon”.

To convert a GLTF into a .bablyon:

  • open you GLTF into the playground and under the debug panel export the scene as a .babylon
    (you could also use the blender exporter as well)

To convert a .babylon into a .incremental.babylon:

  • make sure you have visual studio (windows or mac) or monodevelop (linux)
  • clone the project and them open the .csproj file into the visual studio or monodevelop (Exporters/Tools/MakeIncremental at master · BabylonJS/Exporters · GitHub)
  • “build” the project and then in the “bin” folder you will find the “.exe” program, just run it in the terminal like this: MakeIncremental.exe /i:PATH_TO_BABYLON /o:PATH_TO_OUTPUT_INCREMENTAL_BABYLON

There’s also the node approach using this lib (babylonjs-make-incremental - npm) if you feel more comfortable with node than .net.

Unfortunately doesn’t seem to be an easy thing to do, but it’s possible.

Thank you!

Hi npm package that you have mentioned is not working
This error is coming : no such file or directory, chmod ‘D:\gitlab\IncrementalLoading\node_modules\babylonjs-make-incremental\cli.js’

Yesterday I’ve updated the .net project and my PR was approved, so now you can try using the regualr tool:

This is the usage:
MakeIncremental /i:"SOURCE_FILE" /o:"SOURCE_DEST" [/textures]

1 Like

I want to generate incremental model runtime and for that I need node npm package which can convert my model at the time of loading. Can u help in fixing the bug in node package??

I just wrote some documentation on progressively loading a glTF. Does this help?

Hey Gary,

This looks amazing! Especially if one wants to load a huge model. I don’t understand how do I import my model (.gltf) similar to the way you uploaded the car model? Looking forward for a reply. Thanks.

@saifshk17 I’m not sure I understand what you are asking. Can you be a bit more specific?