2 varying vec3 lightDir; // interpolated surface local coordinate light direction
3 varying vec3 viewDir; // interpolated surface local coordinate view direction
7 // Do standard vertex stuff
9 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
10 gl_TexCoord[0] = gl_MultiTexCoord0;
12 // Compute the binormal
14 vec3 n = normalize(gl_NormalMatrix * gl_Normal);
15 //vec3 t = normalize(gl_NormalMatrix * vec3 (gl_Color));
16 vec3 t = normalize(cross(vec3(1.141, 2.78, 3.14), n));
19 // Transform light position into surface local coordinates
21 vec3 LightPosition = gl_LightSource[0].position.xyz;
24 v.x = dot(LightPosition, t);
25 v.y = dot(LightPosition, b);
26 v.z = dot(LightPosition, n);
27 lightDir = normalize(v);
28 vec3 pos = vec3 (gl_ModelViewMatrix * gl_Vertex);
34 viewDir = normalize(v);