I have a glb file that i load on my threejs. It works fine loading the file and it renders ok. But when i rotate the camera to watch some washing machines i left in the scene the camera freezes. The browser freezes and it takes like 3 or 5 seconds to unfreeze and show the place correctly.
After it is rendered completelly, i can see rotate the camera without problem that the scene goes smoothly. What is causing this washing machines to freeze my camera is my main question
I will upload the glb file here and the url of my threejs application:
File: https://drive.google.com/file/d/18tqnZ9r6WDbxmTD9jpJ_Cenc-5vRvYul/view?usp=sharing
It’s a 115 megabyte glb. Not only will that be slow to download, just the amount of geometry+textures uploading to the GPU will cause a big Kachug like that.
You’ll probably need to simplify or find a simpler model. You can try using some compression tools like Meshopt or DRACO, and also using at least jpg compressed textures.
You can drag a GLB onto here: https://gltf.report/ to see what it contains. In your case I see about 30(!), 4k textures being loaded. Odds are its just those uploading to the GPU the first time the camera sees them, that is causing your lag spikes.
Thank you…i will try remove some stuff from the model so it can load faster
Maybe you rotate camera to washing machines which was not in camera view before it and now gpu calculate their textures, geometry, material etc.
1 Like