- varying vec4 pos;
- void main(void)
- {
- // tell opengl the transformed position of the vertex
- // gl_Vertex is the vector you set using glVertexXx
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- // hand the position over to the fragment shader via a varying variable
- pos = gl_Vertex;
- // dont know about this line, I think this declares the color value you
- // get in the fragment shader, just as if you handed it over to it
- // via a varying variable
- // gl_Color is the color you set using glColorXx
- gl_FrontColor = gl_Color;
- }