google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.93k stars 818 forks source link

Getting error with one of the models only on smartphones #2155

Closed dhruvadhia1 closed 3 years ago

dhruvadhia1 commented 3 years ago

The configurator keeps loading repeatedly only on mobile phones and crashes ultimately with this model. However, the same model works on mobile via babylonjs. https://thecela.com/experiment/elder/

Live Demo

https://tinyurl.com/yec6vpaz

Version

Latest

Browser Affected

OS

elalish commented 3 years ago

Is this just a problem with one model? Does it repro with a simple model-viewer element? It looks like a very large model, so you might be running out of GPU memory on the phone.

dhruvadhia1 commented 3 years ago

I tested it on simple model-viewer one line of code and it doesnt work. Now its interesting to note that the model viewer is working with some really high poly models with more than a million polys, but with this one it has issues.

Here is a test with minimal model viewer code. And it crashes only on mobile. https://thecela.com/experiment/elder/test.html

But what I found interesting was it crashes only when height and width are at 100% for modelviewer in css. So somehow the larger paint area is causing the crash? And we hardly have this with any other models.

elalish commented 3 years ago

Interesting. How large are the textures? That's what usually kills the GPU memory. You might want to try KTX2 encoding them, which will reduce memory pressure significantly.