   Help:error x4004 there are more active values than registers
  I'm writing a shader for Skin Animation.But there's always a error message when running my shader:"error x4004 there are more active values than registers"How to deal with it?thanks.Here is my code:matrix WVPMatrix;float4 quat[100];float3 tran[100];struct VS_INPUT{float3 Position : POSITION;float3 Normal : NORMAL0;float2 TexCoord0 : TEXCOORD0;float4 Weights:TEXCOORD1;float4 Indices:TEXCOORD2;};struct VS_OUTPUT{float4 Pos : POSITION;float3 Diffuse : COLOR;float2 Tex0 : TEXCOORD0;};float4x4 BuildFromTransRot( float3 translation, float4 rot ){float4 rotation = rot;float xx = rotation.x * rotation.x * 2.0f, yy = rotation.y * rotation.y * 2.0f, zz = rotation.z * rotation.z * 2.0f;float xy = rotation.x * rotation.y * 2.0f, zw = rotation.z * rotation.w * 2.0f, xz = rotation.x * rotation.z * 2.0f;float yw = rotation.y * rotation.w * 2.0f, yz = rotation.y * rotation.z * 2.0f, xw = rotation.x * rotation.w * 2.0f;float4x4 m = {{1.0f - yy - zz, xy + zw, xz - yw, 0},{xy - zw, 1.0f - xx - zz, yz + xw, 0},{xz + yw, yz - xw, 1.0f - xx - yy, 0},{translation.x, translation.y, translation.z, 1}};return m;}float4x4 GetBoneElement( float index ){return BuildFromTransRot(tran[index], quat[index] );}VS_OUTPUT main(VS_INPUT input){VS_OUTPUT Out = (VS_OUTPUT)0;float4x4 skinTransform = 0;skinTransform += GetBoneElement(input.Indices.x) * input.Weights.x;skinTransform += GetBoneElement(input.Indices.y) * input.Weights.y;skinTransform += GetBoneElement(input.Indices.z) * input.Weights.z;skinTransform += GetBoneElement(input.Indices.w) * input.Weights.w;float4 localpos = mul(input.Position, skinTransform);Out.Pos = mul( localpos, WVPMatrix );Out.Tex0 = input.TexCoord0;return Out;}
  hi.what shader model try,  shader 3 or later.or pass all themfloat4 quat[100];float3 tran[100];into a texture then use it.   ;  In this case you may find that compiling with optimizations disabled ( D3DXSHADER_SKIPOPTIMIZATION ) will make it work even for VS 2.0. This isn't as bad for performance as it sounds as the driver will optimize the shader anyway.The problem isn't the size of those arrays, it's the complexity of the maths. You could also try doing the conversion from quaternion to matrix (BuildFromTransRot()) in code rather than in the shader.   ;  thanks!   