PDA

View Full Version : GLSL skinning



LaBasX2
09-19-2005, 02:17 PM
Hello everybody,

I'm trying to do hardware skinning with GLSL but I'm always getting a linker error when trying to access my bone matrix array. Here is a simple test shader that causes the problem


uniform int index;
uniform mat4 skeleton[64];

void main(void) {

mat4 test = skeleton[index];

gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

}I'm getting an error C5041: cannot locate suitable resource to bind parameter "<null atom>"

Can anybody tell me what's wrong with the code or how else I can access the bone array with a vertex attribute index?

Thanks a lot!

Korval
09-19-2005, 04:26 PM
The type 'mat4' takes up 4 'vec4's'. Therefore, 64 of them will require 4 * 64 or 256 vec4's. Which is the absolute limit in uniforms (on advanced hardware). Add one "int index", and you overflow the number of uniforms.

LaBasX2
09-19-2005, 10:28 PM
Ah that's the problem, so simple. Thank you very much Korval!