Just a general idea, try changing “vs_3_0” and “ps_3_0” to “vs_4_0” and “ps_4_0” for more registers to work with (regarding the first error, haven’t really looked at your code).
the problem here is that your shader exceeds the shader model 3 register count as the compiler states, so you could either remove some inputs and/or lower your bone matrix input count. for shader model 4 or 5 to work you’d have to adapt the shader to those shader models and ofcourse use the dx 11 version of vvvv. (doesn’t work on stock vvvv+addons)
edit: well, to be exact you could load models with >50 bones but you would only be able to set the first 50 bone matrices through this shader. a possible way to work around this problem could be to break bigger models up into parts with total bonecount <= 50.
In dx11 I use a buffer for skinning (since also using instancing most times, so I build a big fat buffer then do lookup in vs).
Since in dx9 you don’t have access to that, you can apply the same technique as for particles.
Let’s say you have 1024 bones, and one model (to keep it simple, but variable bone size / multiple models is just a little bit more code).
You create a texture (4 channels float32), size:
4 rows and 1024 columns (or opposite)
Each column represents a full bone matrix.
Each row is one part of the matrix.
So you write your data as dynamic texture (making sure you layout properly).
Then in VS you do texture lookup (tex2dLod)
You need 4 lookup per bone (since basically uv will be something like)
float4 row1 = tex2dlod(float2(boneid/bonecount,0),0);
float4 row2 = tex2dlod(float2(boneid/bonecount,0.333333),0);
and so on…
Don’t forget to use either point sampler or no sampling, and to make sure to clamp.
That’s it, from your 4 rows reconstruct your matrix and do as usual.
Thanks that makes sense. DX9 part is clear. Now it seems like I have to investigate Buffers in DX11 more. Having a working DX11 skinning shader would be real good. I searched the internet for an example but it seems this kind of stuff is not freely available.