-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
specify / implement skinning #100
Comments
I suggest important changes for the skinning proposal.
Doing so would allow us to use vertex attributes for both weights and bone indices. They could be anything between FLOAT and FLOAT_VEC4 .And SHORT & SHORT_VEC4 for bone indices. Typically, for hardware rendering (in every examples I have seen and in my experience) the number of influences limit is 4. (to fit a FLOAT_VEC4). It could be thought that one drawback of this approach would be to waste space because attributes of fixed size. Last but not least, matrixes for bones must be stored in uniform memory, but this one is limited. |
@tparisi @RemiArnaud @pjcozzi this is what we have for skinning. Beginning with
Then how do we use this ? In
As discussed earlier then, we adopted an hardware rendering friendly approach with the weights and joints indices passed as attributes to the mesh. This simpler approach fits nicely in the existing design. (so we got rid of weights indices). Then a mesh is defined this way (note WEIGHT and JOINT):
and finally, in the technique we a special semantic "JOINT_MATRIX" that is skinning matrix that is the concatenation of all the matrices needed for skinning, note that the way this matrix is implemented is up the adopter and thus is mostly of use for the adopter who want to use the provided shaders.
Last but not least, all this is implemented in the converter and in montage viewer as well. Next thing to be discussed is how to handle a maximum number of bones per mesh, this is planned and I will complete the proposal once this is implemented and tested. But what we have should be enough to start updating the specification. |
@kmammou FYI: this is my proposal for skinning, as you see weights and bone indices are attributes (say stream) and should fit well in your compression. |
@fabrobinet this looks great. Simpler is always better! So what do weights and joints indices look like? Are you going with FLOAT and FLOAT_VEC4, SHORT and SHORT_VEC4? Do you have an example we can look at? |
I will send an example over email. weights and joints are both FLOAT_VEC4. i.e 4 weights * 4 influences (index to retrieve in the matrix array). |
@fabrobinet with the exception of what is to come with #164, have there been any changes to skinning since your above example? |
I think it is up to date, but there are still some cases I need to implement and provide input for, and check implication on the spec if any when:
|
I know you are @RemiArnaud discussed this, but if this adds any complexity at all, I would skip it; I'm not sure that anyone cares in practice. |
I noticed that inverseBindMatrices in skins is an accessor.
|
@RemiArnaud yes. See #238. Please search the issues. |
thanks ! Another question: how do I know the size of JOINT_MATRIX ? Especially in the case there are multiple meshes. |
It's length is (at least) the number of inverse-bind matrices. The generated shader can be optimized, see #183.
Yes. @fabrobinet will know if this is already implemented in the converter. |
I talked to Fabrice about this, the size is in a completely different part of the json - can't allocate the uniform by reading the technique. We should add a size to uniforms, when different than 1. Opening a new issue to track this. |
@fabrobinet is this resolved for 1.0? |
we can close this, later points in this issue are all tracked by individual issues already |
Some years have passed, and the four weight limitation is an issue. Six weights is common, and our use case has eight. Unreal currently supports a maximum of eight. Is there an open issue, or is this the right place to discuss it? I'm not asking for a variable number of influences per vertex, only that the number of influences be declared in the gltf file. |
Thanks |
No description provided.
The text was updated successfully, but these errors were encountered: