Ok, I need help on the weight shader. Not really sure what the correct fix is.
I get an error when you try to display the mesh in CPU Animation mode and then turn on the Weight Shader and the BoneMap Shader it will drop this error:
I know, that I have fixed this in the past but cant for the life of me remember how and will have to go look up some of my other shaders to figure it out but do not have time right this second. Ill fix it as soon as I can but was just wondering what others would suggest as an easy fix.
Thereās probably a lot more information with the error than just this line?
Thatās near impossible to find whatās going on with just this line.
One possible thing is that the shader is using a matricesIndices variable in the code, that has not been declared. Given the name of the variable, it would mean the attribute matricesIndices has not been declared in the vertex shader.
Was actually looking at my code of a shader that does the same think but works, the only thing I am missing is the specific attribute declaration to make sure that stuff is still there when it switches to CPU. Iāll test that when I get home and if I fixed it Iāll push.
Yāall can recreate it really easy, just go into a scene with a skeleton rigged to a mesh, go into the inspector and select the mesh toggle it to CPU mode then turn on the BoneWeights Shader.
I tried adding the attributes to the shader, but that did not seem to fix it⦠not sure why it works on the skeleton widget but not on this?
The matricesIndices and matricesWeights attributes are passed to the shader only when the bones are computed on the GPU (thereās no point to pass them otherwise).
So I guess the Display BoneWeights switch in the inspector should be disabled when Compute bones using shader is disabled.
I have a use case that needs it, we are working on real time weight painting and need the CPU version to work. Ive gotten it to work with the skeleton widget where we were able to make it selectable even with animations, but for some reason these ones are not doing the same thing with the same attributes. Iām just wondering what I did differently.
Are you sure you were using CPU skinning? With the existing code I donāt see how it can work because in CPU mode the indices/weights attributes are not passed to the shader.