Recently, I received a small demand to implement a page showing a 50M size OBJ model.
Confirm requirements and start:
- Introduce three.js and corresponding loader
- Load MTL and OBJ according to the case
- Chrome runs flawlessly
Then when I confidently opened it in Safari on my phone, I kept crashing and automatically refreshing the page when the OBJ file had finished loading, endlessly.
Calm check, no solution… Switch to the threejs case obj found normal again. OK, thinking maybe obJ file is too big, a compression, or not.
Finally, a comparison shows that the texture file has 8192 pixels, while the sample has 512 pixels.
Picture tool to the whole 2048×2048, solved
It is estimated that the texture file is too large, and the material rendering consumes too much memory, causing the page to crash.