My application is now ready to use a shader instead of the Fixed Function Pipeline. At the moment I am skinning and transforming vertices on the CPU. I need to update my vertex format to include Bone indices and weights. My current vertex struct is as follows:
#define VERTEX_FVF (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_DIFFUSE|D3DFVF_TEX1)
struct VERTEX
{
float x,y,z; // Position
float hx,hy,hz; // Normal
DWORD color; // Color
float tu,tv; // Texture UV
};
But before I dive in I have some questions.
1. Do I still need to SetFVF() with shaders?
2. What do I include in my Vertex Struct and FVF definition to accomodate Bone indices and Weights (I only have 2 bones max influencing a vertex)?
struct VERTEX
{
float x,y,z; // Position
float hx,hy,hz; // Normal
DWORD color; // Color
float tu,tv; // Texture UV
float w1,w2; // Weights
BYTE Indx1, Indx2; //Indices
};
Would this work or do I need to padd for 4 bones? How would the input for the vertex shader look like for the above vertex struct (float2 weights : BLENDWEIGHT0)?3. Is it possible to have two position vectors, "float4 pos2 : POSITION0" as input parameters?
4. My position "Vector" has 3 members, and the transform matrix is 4x4, do I need a dummy unit padding the vector to multiply, how does this affect position, does it have to be 0.0f?






