Based on this sample link of progressive enhancement with React Suspense, I tried to use the method in my project with another .glb file.
I got the 3D model from Sketchfab with initial size of 10MB. With the help of Sqoosh and GLTF Report, I managed to reduce the final .glb size to around 1MB by optimizing all the jpeg/png images used by the model. Then, I made a smaller .glb size of 500kb for the 'blurrier version' fallback.
However, when my 1MB glb is successfully loaded, the whole canvas or frame freezes. This is entirely different compared to the smooth transition from the sample link where the lower-resolution model changes to higher-resolution model without a lag.
This gif below shows the lag/freeze when 1MB model(prettier version) is loaded. The lag is hard to be seen when testing in codesandbox.
It is more obvious when testing after building and serving file in localhost.
Trying with the model from the sample link
- Low resolution glb size : 6kb
- High resolution glb size : 10MB
Smooth transition when high resolution model is done loading in Suspense
User interaction continues to be detected when high resolution model is done loading in Suspense
Trying with model downloaded from Sketchfab
- Low resolution glb size : 534kb
- High resolution glb size : 1119kb
Lag when high resolution model is done loading in Suspense
User interaction is not detected when high resolution model is done loading in Suspense