What is BoneIndex, DXGI_FORMAT ?

This topic is 2022 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

HI~

I wonder BoneIndex DXGI_FORMAT.

This is my result. BONE INDEX, Weight.
[attachment=20693:BoneIndexWeight.png]

I guess, this result is good. But Drawing is wrong.

In MSSDK,

BoneIndex DXGI_FORMAT is { "BONES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, 16, D3D10_INPUT_PER_VERTEX_DATA, 0 }

But I Can't.

My vertex struct is

D3DXVECTOR3 vPos;
D3DXVECTOR3 vNormal;
D3DXVECTOR2 vTex;
D3DXVECTOR3 vBiNormal;
D3DXVECTOR3 vTangent;
UINT nIndex[4];
float fWeight[4];

My BoneIndex DXGI_FORMAT is { "BONES", 0, DXGI_FORMAT_R32G32B32A32_UINT, 0, 56, D3D10_INPUT_PER_VERTEX_DATA, 0 },

Is Wrong ?

Edited by AquaMacker

Share on other sites

Your version is correct.  What is the problem, other than “drawing is wrong”?

Also, why “can’t” you pack them into a single UINT and send them as DXGI_FORMAT_R8G8B8A8_UINT?

L. Spiro

Edited by L. Spiro

Share on other sites

You will need to elaborate on "drawing is wrong". Do you mean the skinning is resulting in warped results? Perhaps if you could provide a screenshot for us.

If the data looks correct for you in bone indices, then what about the matrices that they point to? Do they look correct? What does that constant buffer look like? Do you know if your calculations are done correctly with regards to the parent bone and so on?

Edited by spazzarama

Share on other sites

I solved this problem. ^^a

This is not BoneIndex format but WEIGHT format !

First - wrong DXGI_FORMAT

{ "BONES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, 56, D3D10_INPUT_PER_VERTEX_DATA, 0 },
{ "WEIGHTS", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, 60, D3D10_INPUT_PER_VERTEX_DATA, 0 },

Second - correct DXGI_FORMAT
{ "BONES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, 56, D3D10_INPUT_PER_VERTEX_DATA, 0 },
{ "WEIGHTS", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 60, D3D10_INPUT_PER_VERTEX_DATA, 0 },

I solved it ^^;

But I don't understand yet.
Why float[4] of weight can't use DXGI_FORMAT_R8G8B8A8_UNORM ?
Range of Weight value is 0.0f ~ 1.0f. But can't...

And...
Thanks very much for answer. @L. Spiro, @spazzarama ^^a
Have a good day

Share on other sites

The format enumeration specifies the number of bits in each component. float[4] requires 4 * sizeof(float) = 4 * 32 bits = 128 bits. R8G8B8A8 only provides a total of 32 bits.

EDIT: check the docs for DXGI_FORMAT enumeration.

Edited by Buckeye

Share on other sites

I knew that...

But I refer to MSSDK Skinning10, MSSDK Skinning10 use R8G8B8A8_UNORM.

And I use
R8G8B8A8_UNORM, But I don't working, MSSDK working well.

I don't understand.

Share on other sites

It is really quite simple.

// == COMPONENTS

R = x[0]

G = x[1]

B = x[2]

A = x[3]

// == BITS PER COMPONENT

8 = bits in x

// == SIGN

U = Unsigned (byte)

// == RANGE

NORM = converted to float and normalized to 0.0-1.0

You have float[4].  float is 32 bits.  That’s R32G32B32A32.  Why would you expect R8G8B8A8 to work if you are using R32G32B32A32 (float[4]) for your client data?

It doesn’t make sense.  Why would yours work?

float[4] = R32G32B32A32

byte[4] = R8G8B8A8

So if you are going to send DXGI_FORMAT_R8G8B8A8_UNORM, you need to convert your float[4] into a byte[4].

byte[0] = float[0] * 255 + 0.5
byte[1] = float[1] * 255 + 0.5
byte[2] = float[2] * 255 + 0.5
byte[3] = float[3] * 255 + 0.5

L. Spiro

Share on other sites

Thanks so~~~~~~~~~~~~ much.

Question is solved clearly perfectly.

Have a nice day @L. Spiro, @spazzarama, @Buckeye

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 18
• 33
• 9
• 16
• 22