Closed lilleyse closed 6 years ago
Do we need to do a 1.x branch version of this PR as well, or is it something that can't easily be backported?
Yes still need to do the backport, which shouldn't look too different.
Works as advertised. Please up CHANGES
@lilleyse no rush, but don't forget about this.
@mramato updated.
Thanks!
Fixes two related problems where gltfs were rendering incorrectly because the number of uv attributes did not match the number of position attributes.
The first case is when two primitives in the same mesh use different types of attributes.
This is fixed by storing attribute data on the primitive rather than the mesh. The downside to this is the vertex cache gets reset more often, meaning possibly more duplicate vertices. This won't affect most models, but it could be worse for those that are constantly interleaving
usemtl
lines.The second case is when faces within a primitive use different types of attributes.
Most of the faces look like the first and third, but there would occasionally be faces like the second that don't match the attribute layout. These faces don't really make sense because they are missing uv coordinates and won't be textured properly anyways. Those faces get discarded now though I am thinking they should instead be assigned (0,0) uv coordinates.