Skip to content

How to properly handle skinned meshes? #789

Closed Answered by zeux
Ravbug asked this question in Q&A
Discussion options

You must be logged in to vote

When using an external skin weights table, you indeed will need to remap the indices. Note that there are two functions you are using that both change the vertex indexing: generateVertexRemap/remapVertexBuffer, and optimizeVertexFetch.

If you disable the call to meshopt_optimizeVertexFetch, remap[mVertexId] should work. This would be good to verify.

Once it does, you'd need to change from meshopt_optimizeVertexFetch to meshopt_optimizeVertexFetchRemap (which returns the remap table) plus manually call remapIndexBuffer/remapVertexBuffer and remap the vertex ids in skinning data again.

(normally meshoptimizer expects skin data to be part of the vertex definitions so it "just works" but with…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Ravbug
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants