Frame drops during .append

When appending a glb to a scene, there is a noticeable loss of a few frames.
Is there any way to reduce or avoid this?

WL.scene.append() comes in two forms:

  • .gltf loading: Parses the JSON of the GLTF and copies relevant parts from potential binary buffers in the file. Data formats are converted and prepared to be used by the engine. A bunch of objects, materials, meshes components are created for the objects and materials defined by the GLTF. The textures are uncompressed, meshes not optimized.

  • .bin loading: Loads well optimized and already prepared data by more or less 1:1 copying it into the WASM runtime.

You can already sense from the length of the description that it’s fairly trivial to stream in the .bin files compared to streaming in a .gltf file.

While we have optimizations coming to the GLTF file loading in the upcoming version and might eventually move it into a worker, it will never be faster than loading the .bin files, which are designed to be loaded with minimal overhead.
So if you can, see if you can create streamable .bin files instead..

Thank you for the explanation and link.

A further question I have is, is it possible to convert glb files into bin files from command line interface?

is it possible to convert glb files into bin files from command line interface?

Currently, not directly, but you can work around it by generating the JSON for a .wlp that simply has the glb file in the "files" array. You can package this project via the CLI.