   [DX9/HLSL]Sending an "int" to shader problem
  Hi,I'm trying to implement skeletal animation (using indexed matrix palettes) on the GPU. Here the code snippet I use for vertex blending:for (int iBone = 0; iBone < g_NumBones-1; iBone++){LastWeight = LastWeight + BlendWeightsArray[iBone];    Pos += mul(Input.vg_pos, g_BoneMat[IndexArray[iBone]]) * BlendWeightsArray[iBone];}LastWeight = 1.0f - LastWeight; Pos += (mul(Input.vg_pos, g_BoneMat[IndexArray[g_NumBones-1]]) * LastWeight);LastWeight);Output.vc_pos = mul (Pos, g_ViewProj);For example, max. num. of influences for one of my models is 4. I store this influence data in the mesh container derived structure array of that model. It's a DWORD because ID3DXSkinInfo::ConvertToIndexedBlendedMesh() function calculates it and gives me as a DWORD. I have to use g_NumBones = 4 then it will work correct.  But when I send this value from my program to my shader, vertex blending problem occurs. But if I write "g_NumBones = 4;" line right before the for loop in my shader, then it works perfect.So, the problem is sending data correctly. I tried it again with using UINT for influence data in my program code but nothing changed.What kind of thing causes this problem? Or what I'm doing wrong? Any ideas?Thanks in advance.[Edited by - programci_84 on May 27, 2009 7:55:00 AM]