varying vec3 lightPos;
varying vec3 eyePos;
varying vec4 projPos;
varying float pos;
varying float dist;

void main()
{
  pos = length( ( gl_ModelViewMatrix * gl_Vertex ).xyz );
  eyePos = ( gl_ModelViewMatrix * gl_Vertex ).xyz;
  dist = length( gl_Vertex.xyz );
  
  // view projection
  gl_Position = ftransform();
  projPos = gl_Position;
  
  // position in eyespace
  lightPos = ( gl_ModelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ) ).xyz;
}