 
 vec3 phongModel(in vec4 lightPosition, in vec3 eyeNormal, in vec4 eyePosition)
 {
-  vec3 s = normalize(vec3(lightPosition - eyePosition));
+  vec3 s;
+  if (lightPosition.w == .0)
+  {
+      s = normalize(vec3(lightPosition));
+  }
+  else
+  {
+      s = normalize(vec3(lightPosition - eyePosition));
+  }
   vec3 v = normalize(-eyePosition.xyz);
   vec3 r = reflect(-s, eyeNormal);
 

  vec3 eyeNormal = normalize(normalMat * normal);
  vec4 eyePosition = mvMat * vec4(position,1.0);

  lightIntensity = lightColor * phongModel(lightPosition, eyeNormal, eyePosition);

  gl_Position = mvpMat * vec4(position,1.0);
}


smooth out vec3 lightIntensity;

const vec4 lightPosition[2] = vec4[2](vec4(0,1,1,0), vec4(200,100,30,1));
const vec3 lightColor[2] = vec3[2](vec3(0.6), vec3(0.8));

uniform vec3 materialAmbient = vec3(.2,.2,.2);
uniform vec3 materialDiffuse = vec3(.7);
