2 * \file cube_map_vert.glsl
3 * \brief Cube map vertex shader without shading.
11 uniform mat4 modelViewMatrix;
12 uniform mat4 mvpMatrix;
13 uniform mat3 normalMatrix;
14 uniform mat4 invViewMatrix;
16 smooth out vec3 texCoord0;
21 // transform vertex position and normal into eye coordinates
22 vec3 ecVertex = (modelViewMatrix * vVertex).xyz;
23 vec3 ecNormal = normalMatrix * vNormal;
25 // compute reflection for cube mapping
26 vec4 ecReflection = vec4(reflect(normalize(ecVertex), normalize(ecNormal)), 0.);
29 gl_Position = mvpMatrix * vVertex;
30 texCoord0 = (invViewMatrix * ecReflection).stp;