2 * \file gouraud_vert.glsl
3 * \brief Gouraud vertex shader, uses external function applyLighting().
12 uniform mat4 modelViewMatrix;
13 uniform mat4 projectionMatrix;
14 uniform mat4 mvpMatrix;
15 uniform mat3 normalMatrix;
16 uniform mat4 textureMatrix;
18 smooth out vec4 emissionAmbientDiffuse;
19 smooth out vec4 specular;
20 smooth out vec4 texCoord0;
23 // --- declarations ---
26 void applyLighting(const in vec3 ecVertex, const in vec3 ecNormal,
27 out vec4 emissionAmbientDiffuse, out vec4 specular);
30 // --- implementations ---
35 // transform vertex position and normal into eye coordinates
36 vec3 ecVertex = (modelViewMatrix * vVertex).xyz;
37 vec3 ecNormal = normalMatrix * vNormal;
39 // apply lighting model (to be defined in separate shader)
40 applyLighting(ecVertex, ecNormal, emissionAmbientDiffuse, specular);
43 gl_Position = mvpMatrix * vVertex;
44 texCoord0 = textureMatrix * vTexCoord0;