// GL Shading Language version 1.0 Vertex Shader // Orion Sky Lawlor, olawlor@acm.org, 2006/08/31 (Public Domain) // C++/vertex shader interface uniform float spin_x, spin_y; // Vertex/fragment shader interface: varying vec4 color; // Material diffuse color // Input: gl_Vertex. Output: gl_Position. void main(void) { // Vertex positions come from the C program: vec4 v = gl_Vertex; gl_Position = vec4( /* output X_w */ +1.4*v.x -0.5, /* output Y_w */ +0.3*v.y, /* output Z_w */ 0, /* output w */ 1.0 ); // gl_Position is where onscreen the vertex will be drawn. // We'll set color the same as input position color=gl_Vertex; }