meshopt_simplifyWithAttributes() on skinned meshes #973
-
|
Hi. I'm trying to simplify a skinned mesh with up to 8 bone indices and weights. It's clear to me that bone indices (and their corresponding weights) are not linearly interpolatable, so they cannot really be passed in to meshopt_simplifyWithAttributes() with the expectation of getting sane results.
Unfortunately I don't see the single dominant bone index/weight approach being viable, as it simply mitigates the issue. However, @zeux then said this:
It's not clear to me what he's referring to here. I don't see how it would be possible to reconstruct skinning indices/weights after simplification without them. The simplest brute-force solution to the problem would be to convert the bone indices/weights into a simple weight-per-bone list. I.e: Indices: (1, 3, 5, 7) This array of floats IS linearly interpolatable; you'd just need to convert it back to indices+weights, handling the potential case where there are too many non-zero bone weights and discarding the smallest ones. However, this requires one float per bone, meaning that you'll quickly hit the 32 attribute limit of meshopt_simplifyWithAttributes(). It also seems like it would be slow due to the large number of attributes. What is the standard approach to this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Currently the most practical approach for simplifying skinned meshes is to use I haven't experimented further with dominant bone information after introducing regularization support; it still might be useful but is less critical now. |
Beta Was this translation helpful? Give feedback.
Yes - regularization doesn't directly inspect bone attributes. When using
meshopt_simplifyWithAttributes, you keep all values of positions & attributes (including those that aren't passed to the simplifier), as it only returns an updated index buffer. Of course, this may mean that simplification disregards the attribute variance over some edges if it doesn't know about these attributes; but with regularization it's generally speaking not a significant issue.When using
simplifyWithUpdate, the simplifier will update attributes that it does see; however, since it also produces indices that refer to the original buffer, all attributes that it doesn't see can also be retained as is. Using bon…