Are you still having trouble with this ?
Would need to see the pixel shader vertex input structure to see whats not matched up.
Also you would need two seperate techniques and shaders and call to the correct one based on your if define.
to say all the values here in your vertexdefinition need to match up to the vertex shader input.
so your input would have to look like so.
with color defined you would need to use a vertex in pixel struct like so.
otherwise when color is not used there will be a mis-match on what is sent in data wise and the shader will expect the color to be available in the vertex passed in.
struct VsInSkinColTexNormTanBiTanWeights
{
float4 Position : POSITION0;
float4 Color : COLOR0;
float2 TexureCoordinateA : TEXCOORD0;
float3 Normal : NORMAL0;
float3 Tangent : NORMAL1;
float3 BiTangent : NORMAL2;
float4 BlendIndices : BLENDINDICES0;
float4 BlendWeights : BLENDWEIGHT0;
};
without color defined you would need to use one like this.
while this will work for both this obviously doesn't use the color.
hence the vertexshader nor the technique cant be the same as the one that does use color.
struct VsInSkin__TexNormTanBiTanWeights
{
float4 Position : POSITION0;
//float4 Color : COLOR0;
float2 TexureCoordinateA : TEXCOORD0;
float3 Normal : NORMAL0;
float3 Tangent : NORMAL1;
float3 BiTangent : NORMAL2;
float4 BlendIndices : BLENDINDICES0;
float4 BlendWeights : BLENDWEIGHT0;
};
if USING_COLORED_VERTICES define i don’t recommend doing it this way.
Because you also need to switch techniques to one that uses a pixel shader that expects the proper vertex structure input that would also need to be based on that if define.
I typically directly make two vertice definitions and switch draws and techniques directly to avoid any confusion for stuff like that, which it can cause me later on if i forget wth i did.
Also then both types are available for use at runtime.
.
.
If your using my example off the github project posted as a basis that one is actually old it was the first one i made.
That old one is cool for the basics but it has a major design flaw, that wont let it handle some fbx files.
I had to fundamentally redesign the whole thing to handle more complicated fbx files and its really really messy atm because i was testing to much other stuff with it at the time.
I have been considering pulling if off there and posting the newer one up as its totally different it would be breaking. Though its both simpler and i don’t like it so just beaware it wont handle some fbx files.
I think its about time i clean up the newer one Robust method to import skinned fbx models? and post it as a few people have used it even though i have been recomending people just convert their fbx to gltf and use the sharpgltf project by vpnades