-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoval.vert
More file actions
22 lines (19 loc) · 844 Bytes
/
oval.vert
File metadata and controls
22 lines (19 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#version 330 compatibility
// will be interpolated into the fragment shader:
out vec2 vST; // texture coords
out vec3 vN; // normal vector
out vec3 vL; // vector from point to light
out vec3 vE; // vector from point to eye
out vec3 vMC; // model coordinates
const vec3 LIGHTPOSITION = vec3( 5.0, 5.0, 0.0 );
void
main( )
{
vST = gl_MultiTexCoord0.st;
vMC = gl_Vertex.xyz;
vec4 ECposition = gl_ModelViewMatrix * gl_Vertex; // eye coordinate position
vN = normalize( gl_NormalMatrix * gl_Normal ); // normal vector
vL = LIGHTPOSITION - ECposition.xyz; // vector from the point to the light position
vE = vec3( 0.0, 0.0, 0.0 ) - ECposition.xyz; // vector from the point to the eye position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}