Could not find vertex shader attribute 'normal' to match BindAttributeLocation request


#1

I am working on a particle system and I have a weird error that I can not really explain to my self. The error is the following:

[ error ] ofShader: checkProgramLinkStatus(): program failed to link
[ error ] ofShader: ofShader: program reports:
WARNING: Could not find vertex shader attribute 'normal' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'color' to match BindAttributeLocation request.
ERROR: Input of fragment shader 'vColor' not written by vertex shader

If I have this vertex shader

#version 150
in vec2 texcoord;

uniform sampler2DRect posTexture;
uniform sampler2DRect colTexture;

out vec4 vPosition;
out vec2 vTexCoord;
out vec4 vColor;

void main() {
    // Read position data from texture.
    vec4 pixPos = texture( posTexture, texcoord );
    // Read the color data from texture
    vec4 c = texture( colTexture, texcoord );
    vColor = c;
    vPosition = pixPos;
    vTexCoord = texcoord;
    gl_Position = pixPos;
}

And this fragment shader

#version 150
uniform sampler2DRect colTexture;

in vec2 vTexCoord;
in vec4 vColor;
out vec4 vFragColor;

void main() {
    vec4 texelMain = texture(colTexture,vTexCoord);
    vFragColor = texelMain;
}

I do not receive any error, but as soon as I change the fragment shader to the following code, in order to read the variable vColor from the vertex shader:

#version 150

in vec4 vColor;
out vec4 vFragColor;

void main() {
    vFragColor = vColor;
}

i receive that error message. Any idea why this is happening?


#2

How do you send attribute from c++ side?


#3

I have solved this problem somewhere, but I can not find anymore in which application it was happening :face_with_raised_eyebrow: