I have the following vertex shader:
#version 120
attribute vec4 position;
attribute vec4 acolor;
varying vec4 theColor;
void main(){
gl_Position = position;
//theColor = acolor; //[1]
theColor = vec4(1.0,0.0,0.0,1.0); //[2]
}
When I use line [1], the color is transmitted rigth to the fragment shader, but when I change the color to the attribute acolor
(using the line [2]) the positions of the triangles appear wrong. From the data of the main program, it seems to me like the positions get the color values.
I put two images, 1 with the rigth vertex positions and 2 with the wrong vertex positions.
UPDATE: render code on Github