Throttle processing power/bandwidth to keep stable FPS during loading

Been running into this as well during runtime of our app because we are constantly streaming in new geometry. For now, we limit the number of textures that can be processed a frame and give a breather after each one, that helps performance a lot. I have put the glb download into a worker and transferring the array buffer over which helps but not much.

Been contemplating for a while separating the ktx2 textures from the glb and trying that in a separate thread as well. @Evgeni_Popov that is very helpful, thanks. Would not have guessed about the rendering to off screen canvas part.

Edit: The way we slow them down is by limiting the number of promises that can happen at once in loadMaterialPropertiesAsync and give them a timeout before they can resolve.

2 Likes