varying vec3 eyeVec;
varying vec2 texCoord;
varying vec3 lightVec[];
varying vec3 tNormal;

uniform float pointCount;
uniform vec3 pointPos[];

void main(void)
{
   gl_Position = ftransform();
   texCoord = gl_MultiTexCoord0.xy;
   
   tNormal = normalize(gl_NormalMatrix * gl_Normal);   
   vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);

   eyeVec = -normalize(vVertex);
   
   vec3 ltPos = vec3(gl_ModelViewMatrix * vec4(pointPos[0], 1.0));
   lightVec[0] = ltPos - vVertex;
   
   if(pointCount >= 2.0) {
       ltPos = vec3(gl_ModelViewMatrix * vec4(pointPos[1], 1.0));
       lightVec[1] = ltPos - vVertex;
   }
   
   if(pointCount >= 3.0) {
       ltPos = vec3(gl_ModelViewMatrix * vec4(pointPos[2], 1.0));
       lightVec[2] = ltPos - vVertex;
   }
   
   if(pointCount >= 4.0) {
       ltPos = vec3(gl_ModelViewMatrix * vec4(pointPos[3], 1.0));
       lightVec[3] = ltPos - vVertex;
   }
   
   if(pointCount >= 5.0) {
       ltPos = vec3(gl_ModelViewMatrix * vec4(pointPos[4], 1.0));
       lightVec[4] = ltPos - vVertex;
   }
   
  /*if(pointCount >= 6.0) {
       ltPos = vec3(gl_ModelViewMatrix * vec4(pointPos[5], 0.0));
       lightVec[5] = ltPos - vVertex;
   }*/
}