I got a little problem with my vertex shader:
uniform mat4 bones; // inverse bone bind matrices multiplied with the interpolated bone matrices
uniform mat4 bsm; // bind shape matrix
attribute vec4 weights;
attribute vec4 indices;
vec4 v = gl_Vertex;
vec4 finalVertex = vec4(0.0);
int index1 = int(indices.x);
finalVertex = bones[index1] * v; // right here... if i use bones instead of bones[index1] it works fine :o (i am 100% sure that index1 == 1)
gl_FrontColor = weights;
gl_Position = gl_ModelViewProjectionMatrix * finalVertex;
Someone knows why this happens?
- I read about that dynamic indexing isn't working on lower GLSL versions. Any workarounds?
- This error only exists on an ATI graphics card. On my NVIDIA GC everything works fine.
- I exceeded the maximum usable uniforms and thus had to reduce the mat4 bones to mat4. I think i'll use quaternions in the future