Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/skin.c:
const D3DXMATRIX *bone_inv_transpose_transforms, const void *src_vertices, void *dst_vertices) { - FIXME("iface %p, bone_transforms %p, bone_inv_transpose_transforms %p, src_vertices %p, dst_vertices %p stub!\n", - iface, bone_transforms, bone_inv_transpose_transforms, src_vertices, dst_vertices); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); + DWORD vertex_size = D3DXGetDeclVertexSize(skin->vertex_declaration, 0);
- return E_NOTIMPL; + TRACE("iface %p, bone_transforms %p, bone_inv_transpose_transforms %p, src_vertices %p, dst_vertices %p.\n", + skin, bone_transforms, bone_inv_transpose_transforms, src_vertices, dst_vertices); + + if (bone_inv_transpose_transforms) + { + FIXME("Skinning vertices with two position elements is not supported.\n"); + return E_NOTIMPL; + }
Pretty sure that's not what the inverse of the transpose is for, regardless of what the documentation says. Usually you want to use the inverse of the transpose of a transformation matrix specifically for normals, to make sure that they remain orthogonal with the transformed geometry. Not sure what's up with vertices with two position elements (if supported at all?), I guess it's possible that the comment from https://learn.microsoft.com/en-us/windows/win32/direct3d9/id3dxskininfo--upd... is also correct. I tweaked a bit the test ([usm-test.txt](/uploads/27c8e1a1fed580424ee913b067bdda89/usm-test.txt)) to check my hunch and at least it looks like the inverse transpose matrix is used for normals when present. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9058#note_117065