I think I thought too much about your experience with GLSL. My apologies.
For versions of GLSL prior to version 1.30, you want to write gl_FrontColor or gl_BackColor, which are available in the vertex shader. Check out the changes to the GLSL 1.10 specification ( http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.10.59.pdf ) to learn more about them or the GL_ARB_vertex_shader extension specification.
gl_FrontColor gl_BackColor - 4D RGBA-, .
, , . , . , glColorPointer glDrawArrays, glDrawElements, glDrawRangeElements glMultiDrawElements. , glColorPointer, gl_Color . gl_Color per-vertex.
, , gl_Color. gl_FragColor.
:
void main()
{
gl_FrontColor = gl_Color;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
:
void main()
{
gl_FragColor = gl_Color;
}
, , OpenGL, ftransform().
void main()
{
ftransform();
}
Mads Elvheim