scg3  0.6
phong_vert.glsl
Go to the documentation of this file.
1 /**
2  * \file phong_vert.glsl
3  * \brief Phong vertex shader.
4  */
5 
6 #version 150
7 
8 in vec4 vVertex;
9 in vec3 vNormal;
10 in vec4 vTexCoord0;
11 
12 uniform mat4 modelViewMatrix;
13 uniform mat4 projectionMatrix;
14 uniform mat4 mvpMatrix;
15 uniform mat3 normalMatrix;
16 uniform mat4 textureMatrix;
17 
18 smooth out vec3 ecVertex;
19 smooth out vec3 ecNormal;
20 smooth out vec4 texCoord0;
21 
22 
23 void main() {
24 
25  // transform vertex position and normal into eye coordinates
26  ecVertex = (modelViewMatrix * vVertex).xyz;
27  ecNormal = normalMatrix * vNormal;
28 
29  // set output values
30  gl_Position = mvpMatrix * vVertex;
31  texCoord0 = textureMatrix * vTexCoord0;
32 }