-
Notifications
You must be signed in to change notification settings - Fork 88
#4324 sort indices before splits #4347
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
#4324 sort indices before splits #4347
Conversation
|
|
||
| // remap 32 bit into multiple 16 bit ones | ||
| std::vector<U32> remap(faceVertices.size()); | ||
| size_t vertex_count = meshopt_generateVertexRemap(&remap[0], &indices_32[0], indices_32.size(), &faceVertices[0], faceVertices.size(), sizeof(LLVolumeFace::VertexData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, consider leaving a comment like 'generateVertexRemap attempts to leave no gaps in the resulting sequence which should reduce amount of dupplicated indices after spliting'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, I'll add a comment.
indra/newview/gltf/llgltfloader.cpp
Outdated
| std::vector<U32> optimized_indices(indices_32.size()); | ||
| meshopt_remapIndexBuffer(&optimized_indices[0], &indices_32[0], indices_32.size(), &remap[0]); | ||
|
|
||
| // Sort indices to improve mesh splits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it actually sorts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it actually reorders indices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that it reorders, but does it apply distance or topology based sorting?
Use mesh optimizer to sort indices by vertex order to improve splits.