How to Fill SkinData

Started by AGP, June 16, 2016, 06:44:26 AM

Previous topic - Next topic

raft

Quote from: iguatemi on December 06, 2016, 04:26:32 PM
Should the vertices' weights be normalized?
you mean like sum of weights should be 1 per vertex? no there is no such requirement

iguatemi

Quoteyou mean like sum of weights should be 1 per vertex? no there is no such requirement

great, thanks again :)

AGP

But actually, it's normalized out of 3ds max. So the better question is: can it be normalized or should I multiply them by some value? What is the range of the weights? Thanks in advance.

raft

programatically there is no restriction. if the value is too low its affect will be hardly noticable, if it's too big you will get some weird affects

AGP

#34
I made a printout of the SkinDatas of the same model exported to BONES and exported to my JSON-serialized format in an effort to solve my weight problem (and, with a little luck, kill the UV issue as well with the same proverbial stone).  The following image shows that there's nearly six times more weights and jointIndices in the BONES version. SkinData doesn't hold animation information, does it? And if it's not animation, what could explain this? Thanks in advance.


raft

Quote
SkinData doesn't hold animation information, does it?
no it doesnt.

not sure what's going on there. as a reminder Bones does not have exporter/importer code. it just uses JME's importer

iguatemi

hey, raft. in some models, some vertices have more than 4 joints associated to them. do you have any input on how to handle these cases?

AGP

And is it possible that other engines, like Unity, have some kind of logic to redistribute the weights for models that use more than four? Yet another question: is it trivial to increase the number of joints per vertices, or would that be a massive undertaking?

raft

Quote from: iguatemi on December 23, 2016, 08:49:54 PM
hey, raft. in some models, some vertices have more than 4 joints associated to them. do you have any input on how to handle these cases?

need to check loader (jME, ardor3d) code but most possibly they are simply ignored. I cant see any good reason to support more than 4 joints. to me 4 joints are almost more than good enough

raft

Quote from: AGP on December 25, 2016, 06:46:07 PM
And is it possible that other engines, like Unity, have some kind of logic to redistribute the weights for models that use more than four? Yet another question: is it trivial to increase the number of joints per vertices, or would that be a massive undertaking?
assuming exporter supports it, it should be modified in loader code (jME, ardor3d). but again I dont see any good benefit for that

iguatemi

We have for the same model, two very different vertex counts (triple the number of triangles in jpct versus the unique vertex count which is typically less than the number of triangles in any given model), while retaining the same number of triangles, between jpct and 3ds max. But when we create our SkinData, we use only the number of unique vertices. Now we're thinking that we should be using the number of vertices in jpct. Did that make sense to you and do you agree?

raft

what e
Quote from: iguatemi on January 03, 2017, 08:53:29 PM
We have for the same model, two very different vertex counts (triple the number of triangles in jpct versus the unique vertex count which is typically less than the number of triangles in any given model), while retaining the same number of triangles, between jpct and 3ds max. But when we create our SkinData, we use only the number of unique vertices. Now we're thinking that we should be using the number of vertices in jpct. Did that make sense to you and do you agree?
what exactly is your pipeline?

if you are creating your skeletal data from scratch in code, and loading your model from 3ds format or similar, yes, you possibly need to use number of vertices instead of unique vertex count.

AGP

No, the bones are also defined in the file. What do you mean by our pipeline?

raft

I'm not sure I understand what you are trying to do.

Quote from: AGP on January 04, 2017, 05:24:18 PM
No, the bones are also defined in the file.
then why are you creating a SkinData "manually"?

AGP

I saved the data from 3ds max's skin and I'm applying it to SkinData. Is there an automatic way to calculate SkinData? Am I being thick?