Page 1 of 1

bone indices & bone weights

Posted: Mon Aug 03, 2020 11:48 am
by andy97
Hi,
I'm working on my noesis script and currently stuck at the last step: bone indices + weights. In the screenshots below, it seems like the binding is incorrect.
Image

But in the vertice struct, those bytes are the only one I think that are bone indices and bone weights, following this struct:

Code: Select all

byte	tangent[4]
byte	normal[4]
byte	boneId[4]
byte	weight[4]
float	position[3]
half	texcoord[2]
The file + my script: removed

Re: bone indices & bone weights

Posted: Mon Aug 03, 2020 3:13 pm
by shakotay2
Guess you'll get track of the problem as soon as you've found out why the ring finger of the right hand moves when the left arm moves:
.
ringfinger.jpg

Re: bone indices & bone weights

Posted: Mon Aug 03, 2020 5:38 pm
by andy97
That problem is the reason I need help as is in the screenshot. Seems like all bone indices + weights in data are somehow wrong or my binding is not correct (I just read them straightforwardly without any complex step). Also in my screenshot, those two 'long' fingers seems like they were not binded to any bone. Since the skeleton is as same as your screenshot, I'm still thinking the issues are from original bone weights data .

Re: bone indices & bone weights

Posted: Mon Aug 03, 2020 9:16 pm
by episoder
you may have to remap bones. usually the rig/bones are stored in a way that the shaders can be loaded fast. means you have a maximum amount of bones that can be loaded into shader constants per drawcall. so.. you may have to figure out how many bones the engine loads per call, and then remap the rest to the next draw call and remap those again. it's a lil finicky tbh. but...

Re: bone indices & bone weights

Posted: Tue Aug 04, 2020 1:24 pm
by Bigchillghost
There're two bone index refference tables for submeshes before the vertices buffer.
indextbl.png
A pretty much common workaround for per-byte bone index format.

Re: bone indices & bone weights

Posted: Tue Aug 04, 2020 2:09 pm
by episoder
yes. was just reading the same. this is not dummy data. there's also another table for the 48 bones. seems not related tho. and a bunch of more numbers and "vertex"counts and structures to add or shift around. finicky stuff.

Image

Re: bone indices & bone weights

Posted: Tue Aug 04, 2020 7:47 pm
by andy97
Hi all, sorry didn't see the last 2 posts but I could figure out the same table like you guys mentioned :D it worked, thanks for helping me, really appreciate it :D

Image