pex-renderer
pex-renderer copied to clipboard
[glTF] Load buffers and images in parallel
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
Revisit when refactoring glt loader. Pushed to v5