What you describe sounds fine.
1. Assuming you're maintaining row-major matrices on the CPU side, are you transposing the matrices as you copy them to the CPU buffer, before you copy the array via Map?
Yes, I transpose them before I copy them.
2. Does your video card support 384 (4 x 96) constant registers for the shader version?
Yes it does, but I have set it to a much smaller number and still get the same result.
3. In your shader, do you specify the register for the buffer? If so, do you use the correct slot in VSSetConstantBuffers?
Yes, and no. I have tried both. Same results. And set the correct slot as well.
I would suspect that you're either not binding the constant buffer correctly, or your shader isn't interpreting it correctly. Keep in mind that by default the HLSL compiler will assume that matrices in constant buffers use column-major layout, and will treat them accordingly. If you're storing row-major matrices in your constant buffer, then you can add the "row_major" prefix to your float4x4 array and the compiler will interpret it correctly.
Not pertinent to your question, but do you really have 96 influence bones?
That's nothing, we had 256 just in our heads!
Not pertinent to your question, but do you really have 96 influence bones?
96 turns up a lot, probably because it is the number of bones supported in the shader from the chapter on skeletal animation in Luna's DX11 book.
I have two test models. One with just a few bones, and the other has somewhere are 72 bones I think. But ericrichards22 is right, I sort of got the information from Luna's book. Although, I don't use .fx shaders.
I don't mean that the right values are in the wrong places, I am missing all the right values and have really large numbers in the matrix.
For example, here is the first input matrix:
[0] = 0x0098f4a8 {2.22045002e-016, -1.00000000, 0.000000000, 0.549629986}
[1] = 0x0098f4b8 {1.00000000, 2.22045002e-016, 0.000000000, 386.503998}
[2] = 0x0098f4c8 {0.000000000, -1.54074001e-033, -1.00000000, 0.000000000}
[3] = 0x0098f4d8 {0.000000000, 0.000000000, 0.000000000, 1.00000000}
Here is the first 64 bytes of the buffer
0 [0x00000000-0x00000003] | +2.22045e-016
1 [0x00000004-0x00000007] | -1
2 [0x00000008-0x0000000b] | +0
3 [0x0000000c-0x0000000f] | +0.54962999
4 [0x00000010-0x00000013] | +1
5 [0x00000014-0x00000017] | +2.22045e-016
6 [0x00000018-0x0000001b] | +0
7 [0x0000001c-0x0000001f] | +386.504
8 [0x00000020-0x00000023] | +0
9 [0x00000024-0x00000027] | -1.54074e-033
10 [0x00000028-0x0000002b] | -1
11 [0x0000002c-0x0000002f] | +0
12 [0x00000030-0x00000033] | +0
13 [0x00000034-0x00000037] | +0
14 [0x00000038-0x0000003b] | +0
15 [0x0000003c-0x0000003f] | +1
So far so good, but here is the buffer while debugging the vertex shader:
BoneTransforms[0][0] = x = 0.000000000, y = -1.000000000, z = 0.000000000, w = NaN
BoneTransforms[0][1] = x = 1.000000000, y = 0.000000000, z = 0.000000000, w = NaN
BoneTransforms[0][2] = x = 0.000000000, y = -1996489000.000000000, z = -1.000000000, w = NaN
BoneTransforms[0][3] = x = NaN, y = NaN, z = NaN, w = NaN
It doesn't make sense to me. especially (0,2).y = -1996489000.0???