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

[Branch "rendermesh-refactor"] broken faces #130

Closed
tellypresence opened this issue Apr 4, 2024 · 3 comments
Closed

[Branch "rendermesh-refactor"] broken faces #130

tellypresence opened this issue Apr 4, 2024 · 3 comments
Labels
todo TODO

Comments

@tellypresence
Copy link

tellypresence commented Apr 4, 2024

(Originally reported in issue #128)

In branch rendermesh-refactor, face vertices no longer reflect actual indices, and there are 4, rather than the correct 3, indices per face

(This is a critical problem which makes it impossible to render any model properly)

Model suzanne.usdc face vertex indices

Branch dev

Note that faceVertexIndices reflect actual face vertex indices, and there are 3 vertices per face

mesh[0] mFaces[0][0]: offset[0], faceVertexIndices[0]: 46
mesh[0] mFaces[0][1]: offset[0], faceVertexIndices[1]: 0
mesh[0] mFaces[0][2]: offset[0], faceVertexIndices[2]: 2

mesh[0] mFaces[1][0]: offset[3], faceVertexIndices[3]: 46
mesh[0] mFaces[1][1]: offset[3], faceVertexIndices[4]: 2
mesh[0] mFaces[1][2]: offset[3], faceVertexIndices[5]: 44

mesh[0] mFaces[2][0]: offset[6], faceVertexIndices[6]: 3
mesh[0] mFaces[2][1]: offset[6], faceVertexIndices[7]: 1
mesh[0] mFaces[2][2]: offset[6], faceVertexIndices[8]: 47

mesh[0] mFaces[3][0]: offset[9], faceVertexIndices[9]: 3
mesh[0] mFaces[3][1]: offset[9], faceVertexIndices[10]: 47
mesh[0] mFaces[3][2]: offset[9], faceVertexIndices[11]: 45

mesh[0] mFaces[4][0]: offset[12], faceVertexIndices[12]: 44
mesh[0] mFaces[4][1]: offset[12], faceVertexIndices[13]: 2
mesh[0] mFaces[4][2]: offset[12], faceVertexIndices[14]: 4

branch rendermesh-refactor

The values are simply the position in the array rather than an index of a vertex; also there are 4 vertices per face (dev branch was 3)

mesh[0] mFaces[0][0]: offset[0], faceVertexIndices[0]: 0
mesh[0] mFaces[0][1]: offset[0], faceVertexIndices[1]: 1
mesh[0] mFaces[0][2]: offset[0], faceVertexIndices[2]: 2
mesh[0] mFaces[0][3]: offset[0], faceVertexIndices[3]: 3

mesh[0] mFaces[1][0]: offset[4], faceVertexIndices[4]: 4
mesh[0] mFaces[1][1]: offset[4], faceVertexIndices[5]: 5
mesh[0] mFaces[1][2]: offset[4], faceVertexIndices[6]: 6
mesh[0] mFaces[1][3]: offset[4], faceVertexIndices[7]: 7

mesh[0] mFaces[2][0]: offset[8], faceVertexIndices[8]: 8
mesh[0] mFaces[2][1]: offset[8], faceVertexIndices[9]: 9
mesh[0] mFaces[2][2]: offset[8], faceVertexIndices[10]: 10
mesh[0] mFaces[2][3]: offset[8], faceVertexIndices[11]: 11

mesh[0] mFaces[3][0]: offset[12], faceVertexIndices[12]: 12
mesh[0] mFaces[3][1]: offset[12], faceVertexIndices[13]: 13
mesh[0] mFaces[3][2]: offset[12], faceVertexIndices[14]: 14
mesh[0] mFaces[3][3]: offset[12], faceVertexIndices[15]: 15

mesh[0] mFaces[4][0]: offset[16], faceVertexIndices[16]: 16
mesh[0] mFaces[4][1]: offset[16], faceVertexIndices[17]: 17
mesh[0] mFaces[4][2]: offset[16], faceVertexIndices[18]: 18
mesh[0] mFaces[4][3]: offset[16], faceVertexIndices[19]: 19
@tellypresence
Copy link
Author

tellypresence commented Apr 4, 2024

Here's a few screenshots of rendering models in rendermesh-refactor vs dev branches for reference (the dev branch loads models with valid face data, while the rendermesh-refactor branch doesn't provide correct face vertex index information as indicated above)
Screenshot_20240418-130959

BranchModelScreenshotsNotes
SolidWireframe
rendermesh-refactorcompsognathus.usdzFixed in recent commit
toy_car.usdz
suzanne.usdc
toy_drummer_idle.usdzPoints OK, but no valid face data
devtoy_drummer_idle.usdzValid face data, inferred normals used for lighting calculations etc

@tellypresence tellypresence changed the title [branch "rendermesh-refactor"] broken faces [Branch "rendermesh-refactor"] broken faces Apr 5, 2024
@syoyo syoyo added the todo TODO label Apr 6, 2024
@tellypresence
Copy link
Author

tellypresence commented Apr 13, 2024

As of rendermesh-refactor commit d3ac233 the situation has vastly improved, thank you.

I think the face indices are now correct.

@tellypresence
Copy link
Author

AFAICT face indices are working as well as dev branch, so this issue is fixed.

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

No branches or pull requests

2 participants