Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unstable" vertices when rotating a glTF model #14692

Closed
kevinresol opened this issue Aug 11, 2018 · 4 comments
Closed

"Unstable" vertices when rotating a glTF model #14692

kevinresol opened this issue Aug 11, 2018 · 4 comments

Comments

@kevinresol
Copy link

kevinresol commented Aug 11, 2018

Description of the problem

When rotating a glTF model, the model vertices "jump" around (instead of "staying in place")

See the vertices "jumping" with reference to the green grid in the GIF below:

threejs

Reproduce steps

Go to this glTF viewer powered by three.js
https://gltf-viewer.donmccurdy.com/

Extract the two files in the following zip and drag them into the viewer
model.zip

Try rotating the model and notice the walls "flashing", that's due to the unstable vertices.
To further verify, try using the wireframe option and zoom in further to see the vertices "moving" when rotating the model.

Result GIF: https://gph.is/2AWQRnH

Three.js version
  • r95
Browser & OS

Tested on the following combinations and all exhibits the problem:

  • Mac + Chrome
  • Windows + Chrome
  • Windows + FireFox
  • Windows + Edge
@donmccurdy
Copy link
Collaborator

donmccurdy commented Aug 12, 2018

This model has some issues that will need to be fixed for viewing in a realtime engine —

  • 3500 nodes
  • 1100 meshes
  • z-fighting

I'm getting about 15fps when viewing the model, and a lot of flickering from z-fighting. You may be able to fix the z-fighting by reducing distance between camera near/far parameters, or there may be geometry in the mesh that just overlaps, in which case you'd need to clean it up with a modelling tool.

This is more of a help question than a bug, so I'll close this issue, but feel free to post in the forum (http://discourse.threejs.org/) for more help.

@kevinresol
Copy link
Author

kevinresol commented Aug 13, 2018

The topic of the issue is not about z-fighting, which I understand as two surfaces lying on the exact same plane. But I am talking about the vertices jumping as shown in the GIF.

In the embeded GIF I am using a transparent material, you can clearly see that there are no overlapping faces, so z-fighting is irrelevant.

In the linked GIF, in which the materials are rendered as wireframe, you can also see the vertices jumping. Again z-fighting is irrelevant.

In fact, the the flickering is caused by the vertices jumping such that sometimes a vertex is in front of the other and sometimes it is behind. It is simply not z-fighting.

The number of meshes and nodes are also irrelevant, I expect a slowdown but not vertices jumping around. I still see this as a BUG.

@donmccurdy
Copy link
Collaborator

donmccurdy commented Aug 13, 2018

Hm perhaps z-fighting is not the right word, what I mean to say is that there are precision issues with the scale and geometry in your model, and this results in the vertices appearing in the wrong places, e.g. in front of vertices they shouldn't be in front of, and "jumping" from frame to frame.

This is not specific to any particular model format, but may occur with particular modeling programs and workflows more than others... If I import your model to Blender, join the meshes, move the object to the origin, and re-export to glTF, these issues disappear:

model_scaled.glb.zip

@kevinresol
Copy link
Author

I will check the workflow then, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants