// 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; float c=1.0/sqrt(2.0); mat4 m=mat4(0.0); m[0].x=c; m[1].x=-c; m[0].y=c; m[1].y=c; m[2].z=1.0; m[3].w=1.0; gl_Position = m*v; // gl_Position is where onscreen the vertex will be drawn. // We'll set color the same as input position color=gl_Vertex; }