pex-gl / pex-renderer

Physically based renderer (PBR) and scene graph for PEX.
https://pex-gl.github.io/pex-renderer/examples/index.html
MIT License
234 stars 16 forks source link

[glTF] Load buffers and images in parallel #286

Open dmnsgn opened 3 years ago

dmnsgn commented 3 years ago

As convenient as it is, a for-of loop will run sequentially. Need to use:

   await Promise.all(images.map(async (image) => {
    await loadImage(image)
   // ...
  }));

https://github.com/pex-gl/pex-renderer/blob/ed823d46117089996a63fdec02a74650ba6e7cc0/loaders/glTF.js#L916-L942

https://github.com/pex-gl/pex-renderer/blob/ed823d46117089996a63fdec02a74650ba6e7cc0/loaders/glTF.js#L882-L892

vorg commented 10 months ago

Revisit when refactoring glt loader. Pushed to v5