Closed GoogleCodeExporter closed 9 years ago
I managed to reproduce the issue indeed.
In my attached screenshot I display the skeleton and the mesh skinned with the
bind-pose. Skinning is ok, but the bind-pose looks wrong, should be more like a
T-pose with no position offset. I'll investigate that.
In the meantime you can try rendering the animated skeleton by calling:
_renderer->DrawPosture(skeleton_, models_, ozz::math::Float4x4::identity());
Thanks for posting.
Original comment by guillaum...@gmail.com
on 29 Dec 2014 at 11:05
Attachments:
Original comment by guillaum...@gmail.com
on 29 Dec 2014 at 11:06
I can now confirm that this is a bind-pose issue.
Skinning sample computes inverse bind-pose matrices (used by the skinning job)
based on the skeleton bind-pose. Skeleton bind-pose is extracted by fbx2skel
tool, which uses the first frame of the default take (Fbx animation) as
bind-pose.
In the case of Humanoid.fbx, the default take is not the expected bind-pose. To
use current ozz pipeline, you'd need to have another fbx file to use with
fbx2skel, where the skeleton would be in bind-pose (or T-pose), or modify
Humanoid.fbx to set the T-pose as the default take. This is a solution many
pipelines use, but it's not the most robust.
Another option is to extract the bind-pose from the FbxMesh. For each set of
vertices that are affected by skinning, Fbx stores the "global initial position
of the link node" in each FbxCluster. This is the transformation of joints used
during skinning setup, aka the bind-pose. This option works well, as shown in
the attached screen shot. Its drawback is that the bind-pose of joints that
aren't transforming any vertex are not available (which would be required to
build the whole skeleton bind-pose).
The final implementation I'm working on stores inverse bind-pose matrices,
extracted from FbxMesh clusters, in the ozz::sample::Mesh directly. Skeleton
bind-pose would remain though, but would be more like a rest-pose. It's a bit
more memory consuming (1 matrix per joint), but it's 100% robust. Also another
benefit is that meshes with different bind-poses could be still use the same
skeleton.
Original comment by guillaum...@gmail.com
on 10 Jan 2015 at 11:19
Attachments:
Original comment by guillaum...@gmail.com
on 10 Jan 2015 at 11:19
Ah, I understand. Unfortunately Animation was the *one* topic not covered on my
University games programming course - from your post it sounds like you're
leaning towards the third solution and with my limited knowledge I would be
inclided to agree it does sound by far the most robust. Especially regarding
skeleton re-use. I have a feeling I would need to change my existing code to
work with the changes but it would definitely be worth it. Excited for the
update. Thanks.
Original comment by ThomasBu...@gmail.com
on 11 Jan 2015 at 1:48
I don't plan any change in ozz interface, only in Fbx tools implementation
(greater robustness) and skinning sample (to use mesh inverse bind-pose instead
of computing them from the skeleton). So I hope and expect the impact should be
minor on your existing code.
Thanks for posting.
Original comment by guillaum...@gmail.com
on 11 Jan 2015 at 2:37
Fixed in bindpose branch. Will be pushed in the next release.
Original comment by guillaum...@gmail.com
on 25 Jan 2015 at 9:56
Original comment by guillaum...@gmail.com
on 25 Jan 2015 at 9:57
Fixed on version 0.7.2.
Original comment by guillaum...@gmail.com
on 19 Feb 2015 at 10:05
Original issue reported on code.google.com by
ThomasBu...@gmail.com
on 28 Dec 2014 at 10:47Attachments: