Hardware instancing problem with Panda 1.8

I trimmed down my own shader which does work, give it a try. It uses a 4x4 matrix for each instance stacked up in a vec4 array. This is because Panda doesn’t support arrays of matrices in GLSL yet, but vec4 it does. You can simplify if you only need position and not rotation.

Vertex shader:

//GLSL
#version 140
#extension GL_ARB_compatibility : enable

const int num_instances = 1000;
uniform vec4 shader_data[num_instances * 4];

void main() {
  mat4 transform = mat4(shader_data[gl_InstanceID * 4], shader_data[gl_InstanceID * 4 + 1], shader_data[gl_InstanceID * 4 + 2], shader_data[gl_InstanceID * 4 + 3]);
  gl_Position = gl_ModelViewProjectionMatrix * (gl_Vertex * transform);
  gl_TexCoord[0] = gl_MultiTexCoord0;
  gl_FrontColor = gl_Color;
}

Fragment shader:

//GLSL
#version 140
#extension GL_ARB_compatibility : enable

uniform sampler2D p3d_Texture0;

void main() {
  gl_FragColor = texture(p3d_Texture0, vec2(gl_TexCoord[0]));
}