remove .txt suffix from shader source files
[mesa.git] / progs / glsl / reflect.vert
1 // Vertex shader for cube-texture reflection mapping
2 // Brian Paul
3
4
5 varying vec3 normal;
6
7 void main()
8 {
9 vec3 n = gl_NormalMatrix * gl_Normal;
10 vec3 u = normalize(vec3(gl_ModelViewMatrix * gl_Vertex));
11 float two_n_dot_u = 2.0 * dot(n, u);
12 vec4 f;
13 f.xyz = u - n * two_n_dot_u;
14
15 // outputs
16 normal = n;
17 gl_TexCoord[0] = gl_TextureMatrix[0] * f;
18 gl_Position = ftransform();
19 }