When i start moving in game, i see some freezes, that happened only once, after recording with dev tools, i saw that freezes are called by Image Decode(as i understand it's decoding textures for my geometries). So is there any way to "precode" images, and start game without that freezes?
recorder screen
One solution to mitigate this problem is the usage of ImageBitmap. With this API, the image decode is going to happen in a separate thread without blocking the animation loop. In three.js you can use ImageBitmapLoader as a more performant substitute to ImageLoader. Have a look at the following example to see the loader in action:
https://threejs.org/examples/webgl_loader_imagebitmap.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With