varying vec3 normal;
varying float pos;

void main()
{
  // position
  pos = length( (gl_ModelViewMatrix * gl_Vertex).xyz );

  // normal
  normal = normalize(gl_NormalMatrix * gl_Normal);
    
  // set texture coords
  gl_TexCoord[0] = gl_MultiTexCoord0; // Color Map and normal map share coords
  
  // transform position
  gl_Position = ftransform();
}