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?

What is being returned by the URL you have entered in that example? Also, the link you provided in the tweet is not working.

Did you get to know any method of incremental loading glTF?

Our doc link redirect is apparently broken. @RaananW is on top of it.

In the meantime, please use this:
Progressively Load .glTF Files | Babylon.js Documentation (babylonjs.com)

Link from the tweet should be working again. Thanks @RaananW!

2 Likes

Thanks for providing the link. Can you tell me what is the response coming from the URL you provided in the car example?

The url is the same Progressively Load .glTF Files | Babylon.js Documentation and it explains how to progressively load gltf. What is the missing part for you @salman.sajid ?

1 Like

Sorry, I think I am not able to explain my question clearly. So there is this playground example in the URL.

I wanted to ask what is the response coming from the URL provided in this example which was provided to SceneLoader.AppendAsync function. This URL:
https://cdn.cp.adobe.io/content/2/content/93f19c5b-5587-4f4f-95bd-99295214aade/version/0

Sorry @salman.sajid. I donā€™t know what this means. What do you mean by ā€œresponseā€?

Is there a gltf or glb or babylon file at this end point?