Hi,
I'm having issues with my skeletal animation vertex shader. When animating about 32 models at once I can only get 60 fps, and on low end computers I get even less. Vertex shader below:
uniform mat4 boneMatrixes[128];
void main(){
vec4 a = gl_Vertex;
// Apply bone transformation
a = boneMatrixes[int(gl_Normal.x)] * gl_Vertex;
gl_Position = gl_ModelViewProjectionMatrix * a;
gl_TexCoord[0] = gl_MultiTexCoord0;
}
Parameters are bound like:
int boneMatrixesName = ARBShaderObjects.glGetUniformLocationARB(mProgramShader, "boneMatrixes");
// matrixFloatBuffer is a FloatBuffer of size 128 * 16
ARBShaderObjects.glUniformMatrix4ARB(boneMatrixesName, false, matrixFloatBuffer);
Commenting out the
a = boneMatrixes[int(gl_Normal.x)] * gl_Vertex;
line increases performance by about 500%. How can I increase performance for this vertex shader? It looks as simple and fast as possible. Any help would be much appreciated!