google / model-viewer

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

Rendering Issues on Modelviewer Editor #4815

Closed sprengerst closed 1 month ago

sprengerst commented 3 months ago

Some models stopped working if they are turned, it seems that the rendering engines has troubles showing the GLB. They disappear after some movements.

https://github.com/google/model-viewer/assets/6854862/d00b0e1d-056a-4d79-955f-69de4f66c6eb

Live Demo

https://modelviewer.dev/editor/

Version

Browser Affected

OS

sprengerst commented 3 months ago

https://drive.google.com/file/d/1KXACTYyPKMsvw2EeI0NqDdVEmFWkcNGU/view?usp=sharing

Here is the GLB

elalish commented 3 months ago

Wow, that's crazy! I can repro, and weirder yet, it does not repro in the three.js editor, which should be using the same shaders. It sort of looks like z-fighting - you don't have coplanar triangles or anything weird like that, right?

Is this a regression? Was there ever a time when this model worked properly in our editor?

sprengerst commented 3 months ago

Hi, yes, this model worked before. There is nothing special to it, as you said it works (worked) with ThreeJS & ModelViewer, only a complaint gave us hints that something is wrong. Thanks for having a look. @elalish

sprengerst commented 3 months ago

I thought someone is crazy, after reading the first report :D

elalish commented 3 months ago

Would you mind checking different MV versions to let us know where the regression started? Just change the version string in https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js

sprengerst commented 2 months ago

Hi @elalish I'm sorry we are using it "self built", it's not so easy to downgrade here. We have another GLB where the issue occurs now.

https://drive.google.com/file/d/1qJrURF1M7nGDtAfdV-lZEXd7LP6uKcY9/view?usp=sharing

sprengerst commented 2 months ago

@elalish do you already now what is the problem here?

elalish commented 2 months ago

No, I haven't gotten a chance to look at this yet, and right now I'm prepping for a SIGGRAPH talk. You'll see when there's a PR. However, if you'd like to dig in and show what you find, that's always appreciated!

Vinmossu commented 2 months ago

No, I haven't gotten a chance to look at this yet, and right now I'm prepping for a SIGGRAPH talk. You'll see when there's a PR. However, if you'd like to dig in and show what you find, that's always appreciated!

I have the same issue here, and the only thing I found is that the glitch seems to appear when using at least one alpha blend material with the double sided turned on

sprengerst commented 1 month ago

Hi @elalish, I don't really understand what's the problem, could it be some low level WebGL stuff. Maybe a simple ThreeJS Update could resolve this problem?

elalish commented 1 month ago

Possibly - thanks for the ping, I'll take another look.

elalish commented 1 month ago

Lucky us, you were right!

sprengerst commented 1 month ago

Perfect :) Thanks for the update.