[SOLVED] Panda 1.10 - vertex shader issue

I’m getting the following glsl error with the latest devel build, that didn’t seem to exist in 1.9:

(error): glLinkProgram failed to link a GLSL program with the following program info log: 'Vertex shader(s) failed to link.
Vertex link error: The number of attributes used exceeded the maximum.
'
:display:gsg:glgsg(error): An error occurred while linking GLSL shader program!
Vertex shader(s) failed to link.
Vertex link error: The number of attributes used exceeded the maximum.

I could perhaps clean up the shader I have, but is there any change that might have caused this?

Hmm, what does your shader look like?

Its fairly simple terrain shader - I can possibly remove a few vars, but I didn’t think it was THAT complex.

Vertex:

//GLSL

#version 140
#extension GL_ARB_compatibility : require

uniform float heightstep;
uniform sampler2D height;
in vec2 p3d_MultiTexCoord0;
in vec3 p3d_Normal;
uniform mat4 p3d_ModelViewMatrix;
in vec4 p3d_Vertex;

in vec2 test;
in int flags;

out vec2 texCoord;
out vec2 texCoordd;
out vec4 food;
out vec3 v;
out vec3 N;


void main() {

  float h = texture(height, p3d_MultiTexCoord0).x * heightstep;

  vec4 testpos = gl_Vertex;

  gl_FrontColor.a = float(flags);

  testpos.z = h;

   gl_Position = gl_ModelViewProjectionMatrix * testpos;

  food = vec4(h/5.0,h/5.0,h/5.0,h/5.0);

  texCoord = p3d_MultiTexCoord0;
  texCoordd = test;

  v = vec3(p3d_ModelViewMatrix * p3d_Vertex); 
  N = normalize(p3d_Normal);  

}

Edit: Hmm, replacing gl_Vertex with p3d_vertex gets around the error, but it REALLY makes a mess of the shader (vertices flying every which way)

Edit2: I’m not sure if this is because my other shaders are using gl_ when I should move them ALL over to p3d_. Is gl_vertex deprecated in favour of p3d_vertex? Or should it work?

Yes, gl_Vertex is deprecated and unavailable since GLSL 120. It is probably what is confusing your driver.

Thanks - replaced gl_vertex with p3d_vertex and all seems good now. :slight_smile: