   glVertexAttrib I Pointer? (was Spot my Error)
  Updates on the final post:I'm implementing bone skinning, and trying to send an attribute of int (bone indexes) to the shader to select from an array of matrices. I believe that there is something wrong with my integer attribute, although I can't find it. It appears that the value is always zero. I have 8 bones, and when I render the entire object looks as if it is transformed by the matrix at index 0. If I hardcode the matrix index variable to an different integer it changes which bone the whole mesh is transformed by, so I believe that the matrices are correct.Here's my relevant code snippets://building the vertex shadervShader << "uniform mat4 BoneTransforms[" + Conversions::ItoS(armature.bones.size()) + "];";vShader << "in int BoneIndices;";vShader << "void main() {"vShader << "gl_Position = M4_ViewProjMatrix * M4_ModelMatrix * BoneTransforms[BoneIndices] * vec4(A3_vertex,1);";vShader << "}"; // End Main//Setting up the attributes/uniformsvg.hBoneTransformsUniformArray = glGetUniformLocation(vg.shaderprogram,"BoneTransforms");glUniformMatrix4fv(vg.hBoneTransformsUniformArray,arm.bones.size(),false,arrays);vg.hBoneIndexAttrib = glGetAttribLocation(vg.shaderprogram,"BoneIndices"); //got a good value for index attrib//build the vbosglGenBuffers(buffercount,hBuffers);vg.hBoneIndexBuffer = hBuffers[index++];glBindBuffer(GL_ARRAY_BUFFER,vg.hBoneIndexBuffer );glBufferData(GL_ARRAY_BUFFER,vg.vertexcount*vg.bonecount*sizeof(int),vg.boneindices,GL_STATIC_DRAW_ARB);//vg.boneindices has good values, is an array of values from 0-7//drawing the vbosglEnableVertexAttribArray(vg.hBoneIndexAttrib);glBindBuffer(GL_ARRAY_BUFFER,vg.hBoneIndexBuffer);glVertexAttribPointer(vg.hBoneIndexAttrib,vg.bonecount,GL_INT,FALSE,0,0);glDrawElements(...);This is my first time using integer attributes, and I'm wondering if there is any special quirks to using integers that I'm not aware of. I use this exact same setup for all of my other attribute vbos and I've never had a problem before. Wondering if I'm missing something? I'm getting no errors/warnings during shader compilation, and I'm checking for opengl errors and finding nothing.[Edited by - karwosts on May 17, 2010 12:24:02 AM]
  Update with more confusion:I've determined that BoneIndices is not always zero, but often gigantic numbers.For vertices that I send the attribute zero it is still zero, but for vertices I send as 1-7 it is coming back with gigantic numbers.By changing the output color based on boneindices greater/less than tests, I've determined that all of the other numbers are reading somewhere between 1,070,000,000 and 1,090,000,000.Curiously 2^30 is equal to 1,073,741,824. Maybe some kind of endianness issue? Still investigating.;  Apparently I need to use glVertexAttribIPointer instead of glVertexAttribPointer.Is this the only way to use integers as attributes? Its not even an ARB extension (had to use the EXT version). Theres no mention of it whatsoever in the red book, and I could barely find anything about it on google, and theres no mention of it anywhere in the opengl.org documentation. Seems strange that this is such an undocumented function for something that I would think would be common (buffer of indices).[Edited by - karwosts on May 17, 2010 1:23:31 AM];  It's not undocumented, is part of Core OpenGL 3.0, you can find it in the spec.And yes, it's the only way.   