google / model-viewer

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

White flash in the model-viewer before reloading the page #4592

Closed snl4ch closed 6 months ago

snl4ch commented 7 months ago

Description

When the page reloads in the moment before it, model-viewer fills with white background (Like flash before reloading).

Version

Browser Affected

OS

AR

elalish commented 6 months ago

Can you add a link and repro steps? Ideally a screen recording? Does it work as expected on other devices/browsers/MV versions?

snl4ch commented 6 months ago

Hi! Sorry for late answer. Yes, you can try it on me website https://snl4.ch/ I used this code:

<model-viewer src="/components/models/model.glb" ios-src="/components/models/model.usdz" alt="Show" touch-action="none" disable-pan camera-controls disable-zoom camera-orbit="90deg 80deg 100%" orbit-sensitivity="0.5" interaction-prompt="none" loading="eager"></model-viewer>

https://github.com/google/model-viewer/assets/149927173/4bb29748-d583-49e7-9821-5f257752b56f

I tried a normal reboot, Ctrl + F5 But it can be noted that if you reboot very often, the white flash won't appear, or if you reboot after a long time, it won't do that either. But in normal cases this happens. I haven't tried it on other browsers

elalish commented 6 months ago

I can't repro it on my mac, but our default poster image is white, so you might be seeing that. I would highly recommend you use a poster-image (you can generate seamless ones on our editor) as that will always give a better experience, especially on slow internet, and it'll probably fix this problem as well.